+ Reply to Thread
Results 1 to 9 of 9

Hide rows if date less than today

  1. #1
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    Hide rows if date less than today

    Hi,

    I wish to be able to hide rows if the date value in column B is less than "TODAY" i.e. hide old data.

    I have tried the following code but it doesn't work:

    Please Login or Register  to view this content.
    It doesn't recognise TODAY(). I would also like it to ignore blank or error entries if possible.

    Thank you in advance
    Last edited by jpruffle; 05-16-2009 at 12:09 PM.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: Hide rows if date less than today

    Replacing TODAY() with Now (no brackets) worked for me
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    Re: Hide rows if date less than today

    Thanks for the reply.

    The Now works great but I also need it to hide blank entries, as I have to pre set the range and there is 1000 rows! Is this possible?

    Thanks

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Hide rows if date less than today

    The VBA equivalent to TODAY() is Date.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    Re: Hide rows if date less than today

    Thank you for the reply.

    But again is it possible for the routine to ignore cells with blank data? I only have about 30 dates in there at the moment but the range is upto 1000. As such when I run the routine over 900 rows are being hidden.

    Thanks in advance.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Hide rows if date less than today

    Sure:
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    06-03-2008
    MS-Off Ver
    Excel 2007 (also have access to Excel 2000/2003)
    Posts
    368

    Re: Hide rows if date less than today

    Thanks shg,

    That works great!

  8. #8
    Registered User
    Join Date
    08-28-2017
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    1

    Re: Hide rows if date less than today

    I tried this code but for me it still shows all rows in the range containing dates less than today's date. I want to only show rows with today's date, how would I need to modify the code?

    Please Login or Register  to view this content.
    TIA

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: Hide rows if date less than today

    orsm6 welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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