Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date in Autofilter` (Excel 2000)

    How do I referance an autofilter criteria if I have a date.

    I have a table with differant dates including todays date. I want to filter it on the @now date value. What will the syntax be:

    today_date as string

    Today_date = @now()

    Selection.AutoFilter Field:=a, Criteria1:=today_date

    Thanks

    Mario

  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: Date in Autofilter` (Excel 2000)

    If you are trying to achieve this through VBA, you need to pass the criteria as a string, and for dates the format must US style. Try the following : <pre> Selection.AutoFilter Field:=1, Criteria1:=Format(Now(), "mm/dd/yy")</pre>


    Andrew C

Posting Permissions

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