+ Reply to Thread
Results 1 to 3 of 3

Macro To Filter Dates Based On Data In Selected Cell

  1. #1
    Registered User
    Join Date
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Macro To Filter Dates Based On Data In Selected Cell

    I have a worksheet that requires me to type a date in G1

    When this date is typed IN G1 i would like the Macro to auto filter all the dates from G4 down.

    So if i type date 01/01/2013 i would like the macro to filter all of all dates before this and leave all dates after this date. If it filters a date i would like the entire row to be filtered

    When i delete the date in G1 i would like all the filtered rows to come back

    Is this possible? I have attached a sample sheet

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    11-07-2012
    Location
    .
    MS-Off Ver
    2003 - 2013 for Windows
    Posts
    121

    Re: Macro To Filter Dates Based On Data In Selected Cell

    Hello,

    try a worksheet change event with code along these lines:

    Please Login or Register  to view this content.
    Excel adapts the date format to the respective regional setting of the person who opens the file. If your system date format is not dd/mm/yyyy, then please adapt the row in the code above to your system date format.
    regards, LMP

  3. #3
    Registered User
    Join Date
    02-25-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    79

    Re: Macro To Filter Dates Based On Data In Selected Cell

    Hi IMP thanks very much for this. Its a strange one and something i have never come up against. On my system and spreadsheets everything is formatted for UK dates but your macro did not work, nor did the ones i have tried to use.

    How i got yours to work properly was to set the date format in your code to US format, sounds weird but it is working great now so thanks very much. Problem Solved again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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