+ Reply to Thread
Results 1 to 4 of 4

Filtering by Dates not working correctly

  1. #1
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Filtering by Dates not working correctly

    Please Login or Register  to view this content.
    In column F I have a list of dates (dd/mm/yyyy).
    I can manually filter dates ok, but want to set it to part of code to use automation for a report.

    The code when run, finds nothing, where it should.
    I tried using [CDate] also but also same result.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Filtering by Dates not working correctly

    I'm not sure why, but autofilter in VBA has issues with the regional date format dd/mm/yyyy.

    Try this. It converts the text-dates to serial-dates, then to long.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Re: Filtering by Dates not working correctly

    Thanks AlphaFrog.

    I also just realised if I change the formatting of the textboxes to US style (mm/dd/yyyy) instead of AU (dd/mm/yyyy) is works. Go figure...

  4. #4
    Registered User
    Join Date
    09-17-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Filtering by Dates not working correctly

    Try this and make sure your data in date format:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Calculating difference between 2 dates in excel 2003 - formula not working correctly
    By cf7046 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-03-2013, 10:18 PM
  2. Replies: 9
    Last Post: 03-08-2013, 11:50 AM
  3. CSE Sum-if not working correctly
    By krjohnso in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-30-2009, 05:08 PM
  4. VBA not working correctly
    By HuskerBronco in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-28-2006, 03:15 PM
  5. [SOLVED] MY SPREADSHEET IS NOT FILTERING CORRECTLY
    By leighanne in forum Excel General
    Replies: 2
    Last Post: 04-18-2005, 08:06 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1