+ Reply to Thread
Results 1 to 6 of 6

Macro, autofilter, delete rows outside date range, defined names as criteria

  1. #1
    Forum Contributor
    Join Date
    01-29-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    471

    Macro, autofilter, delete rows outside date range, defined names as criteria

    Hi. I have two named cells that contain dates:
    Please Login or Register  to view this content.
    I would like to have a macro using auto filter to delete rows that do not fall between those dates. Monday as start date and Friday as end date (both inclusive). Maybe this code below that I found on the Internet can be adjusted to do this task:
    Please Login or Register  to view this content.
    This code above prompts with input window box to allow user to manually write the dates but remember I would like to use named cells instead.


    Any ideas

    Cheers
    Rain
    Last edited by rain4u; 04-30-2011 at 04:11 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: Macro, autofilter, delete rows outside date range, defined names as criteria

    What column are the dates in ? Is the sheet the activesheet ? Do you have a header row that should be excluded from inspection ?

  3. #3
    Forum Contributor
    Join Date
    01-29-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    471

    Re: Macro, autofilter, delete rows outside date range, defined names as criteria

    Yes I forgot to mention these details. Active sheet, column 9 ( or column col i) and it does have header row (row1).

    Cheers
    Rain

  4. #4
    Forum Contributor
    Join Date
    01-29-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    471

    Re: Macro, autofilter, delete rows outside date range, defined names as criteria

    *bump*bump*

  5. #5
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: Macro, autofilter, delete rows outside date range, defined names as criteria

    Assumptions:
    -- All values in Column "i' , except for row 1, are dates

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    01-29-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    471

    Re: Macro, autofilter, delete rows outside date range, defined names as criteria

    Thx Nimrod. It works. I also learned from your code. If someone else needs to get the same result but get it by using autofilters then the following would do the job
    Please Login or Register  to view this content.

    Cheers
    Rain

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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