Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Hide Rows (Current Date) / Unhide Rows


Please help me create two macros. First macro, starting with row 10 if dates
are older than 7 days (Date Column D) old then hide them from Sheet1
worksheet. Next macro to unhide all hidden rows starting from row 10 until
cell is empty or null using column A determine if the cell is hidden from
Sheet1 worksheet.

The example listed below the macro should hide 10/01/07 and 10/02/07 since
today is 10/10/07.

Thanks so much!!!!!!!

Example
Column D
10/01/07
10/02/07
10/03/07
10/04/07
10/05/07
10/06/07
10/07/07
10/08/07
10/09/07
10/10/07
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 373
Default Hide Rows (Current Date) / Unhide Rows

Does this work for you? Note that UnhideEm just unhides all rows. Should
be okay unless you want some other rows hidden for some reason. HTH, James

Sub HideOld()
Dim k As Long
For k = 10 To Cells(10, "d").End(xlDown).Row
If Cells(k, "d") < Now - 7 Then Rows(k).EntireRow.Hidden = True
Next k
End Sub

Sub UnhideEm()
Rows.Hidden = False
End Sub

"Joe K." <Joe wrote in message
...

Please help me create two macros. First macro, starting with row 10 if
dates
are older than 7 days (Date Column D) old then hide them from Sheet1
worksheet. Next macro to unhide all hidden rows starting from row 10
until
cell is empty or null using column A determine if the cell is hidden from
Sheet1 worksheet.

The example listed below the macro should hide 10/01/07 and 10/02/07 since
today is 10/10/07.

Thanks so much!!!!!!!

Example
Column D
10/01/07
10/02/07
10/03/07
10/04/07
10/05/07
10/06/07
10/07/07
10/08/07
10/09/07
10/10/07



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
Hide Unhide Rows blackstar Excel Discussion (Misc queries) 2 February 6th 06 09:36 PM
Hide/Unhide Rows Al Excel Programming 3 January 18th 06 07:03 PM
Hide/Unhide Columns representing dates as per Current System Date! gr8guy Excel Programming 3 June 13th 04 10:11 AM
How to hide and unhide rows Michael168[_10_] Excel Programming 1 October 6th 03 11:52 AM


All times are GMT +1. The time now is 10:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"