Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Trenton, Ontario
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Auto Filter Macro (2000)

    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

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Auto Filter Macro (2000)

    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

  3. #3
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Trenton, Ontario
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto Filter Macro (2000)

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •