+ Reply to Thread
Results 1 to 7 of 7

Macro to Filter and Delete Based on Date

  1. #1
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    352

    Macro to Filter and Delete Based on Date

    Hi,
    Sorry but need help once more, I'm putting together a script that I will be using for my Auditing activity.
    I have an Excel Sheet That contains some data and on column "F" are dates. I would like to be able to run a Macro to get only Dates that is 60 days old or older.

    Example:
    Today is 11-September-2012
    From my Attached List I need a Macro that will only capture dates July 11, 2012 or Older (June, May, April or even from last year).
    The rest that are still within the 60 Days period will be deleted.



    Is this possible? Thanks once again, this will be very helpful If I managed to pull this out.
    Attached Files Attached Files
    Last edited by Andrew.Trevayne; 09-11-2012 at 09:57 AM.

  2. #2
    Forum Guru
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2003
    Posts
    4,168

    Re: Macro to Filter and Delete Based on Date

    hi Andrew.Trevayne, please check attahcment, run code "test"
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    352

    Re: Macro to Filter and Delete Based on Date

    Hello Watersev, Thank you! Tried it and it's working.
    However some rows are not being deleted. From my Dummy xls it stops on row 313.

    Do I need to change something with the code?

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    352

    Re: Macro to Filter and Delete Based on Date

    Sorry my bad, those rows do not have DATES!
    This is just perfect! Thank you again.

  5. #5
    Forum Guru
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2003
    Posts
    4,168

    Re: Macro to Filter and Delete Based on Date

    some rows from your sample file have no data in F column, do you need to delete them as well?

  6. #6
    Forum Guru
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2003
    Posts
    4,168

    Re: Macro to Filter and Delete Based on Date

    you are welcome, disregard my last post

  7. #7
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    352

    Re: Macro to Filter and Delete Based on Date

    That's not necessary, this is just perfect! Thank you so much sir! This will help me a lot.

+ 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