• Auto Filter Macro (2000)

    Author
    Topic
    #379793

    Here’s two lines out of my macro that are causing me some problems. I want the macro to Auto Filter dates based on a user entry. So the user types “11/21/02” (no quotes) into cell E2, I want my macro to filter column A, where the filter is set up, so all entries that are equal to cell E2 show up. Then filter column B based on the content of I2.

    Selection.AutoFilter Field:=1, Criteria1:=ActiveSheet.Range(“E2”).Value
    Selection.AutoFilter Field:=2, Criteria1:=ActiveSheet.Range(“I2”).Value

    What am I doing wrong, when it filters no data is appearing.
    Thanks for any advise you can give.
    Stats

    Viewing 0 reply threads
    Author
    Replies
    • #633566

      Make sure that date in the Criteria range (E2) is formatted the same as the data, and when filtering for a single date use

      Selection.AutoFilter Field:=1, Criteria1:=ActiveSheet.Range(“E2”).Text

      Andrew C

      • #633567

        Worked like a charm!!! Thanks for the quick response Andrew, I really appreciate it.
        Stats

    Viewing 0 reply threads
    Reply To: Auto Filter Macro (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: