Hide Rows (Current Date) / Unhide Rows

G

Guest

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
 
Z

Zone

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top