View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Zone[_3_] Zone[_3_] is offline
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