View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JW[_2_] JW[_2_] is offline
external usenet poster
 
Posts: 638
Default Unhide Rows Date Older Than 7 Days

One way:
Sub this()
Rows.Hidden = False
For i = 2 To Cells(Rows.Count, 3).End(xlUp).Row
If Not IsDate(Cells(i, 3).Value) Or _
Not Cells(i, 3).Value < Date - 7 Then _
Cells(i, 3).EntireRow.Hidden = True
Next i
End Sub

This will hide anything that is not a date as well.
Dean P. wrote:
I would like to create a macro to unhide rows in Sheet1 with Dates in Column
(C) that are older than 7 days old from current day. The Dates are in Column
(C) starting in row 2.

Please help me create this unhide macro.

Thanks,

Dean P.