+ Reply to Thread
Results 1 to 5 of 5

Not Date Range, Delete Entire Row

  1. #1
    Forum Contributor
    Join Date
    12-22-2004
    Location
    Kokomo, Indiana
    Posts
    236

    Question Not Date Range, Delete Entire Row

    Sir/Mada,
    How do I delete an entire row if the date in Cell H2 does not fall between 15 July 2009 and 23 January 2010? I'm using Excel 2007 with VBA and operating on a computer running Win XP Pro.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Not Date Range, Delete Entire Row

    Do you mean "if the value in H2 doesn't match the date range, delete the row, repeat this comparison all the way down column H deleting all rows that do not match the date range?"

    Also, are you sure you want to delete and not just "hide temporarily"? If you turn on the DATA > FILTER > AUTOFILTER you can then filter column H by any date range.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Not Date Range, Delete Entire Row

    Look over here at your other thread:
    http://www.excelforum.com/excel-prog...re-row-if.html

  4. #4
    Forum Contributor
    Join Date
    12-22-2004
    Location
    Kokomo, Indiana
    Posts
    236

    Question Re: Not Date Range, Delete Entire Row

    I do want to delete and not hide. If using the AutoFilter the most direct with least lines of code, I'm for it. How do I set the range of dates using the Autofilter. Thanks.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Not Date Range, Delete Entire Row

    I think the best way is presented already in your other post. Use that solution for this problem, too. See post #3 above.

+ 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