I have macro that will search rows and hide them if dates are older than x days...
I'm attempting now to do similar with a table. Two column table, column A is text data, column B are the dates.
I need to clear contents of each row that the date in column B is older than 30 days.
The following I found through a google search, it will clear contents of the entire row, does not look at tables...
I'm attempting now to do similar with a table. Two column table, column A is text data, column B are the dates.
I need to clear contents of each row that the date in column B is older than 30 days.
The following I found through a google search, it will clear contents of the entire row, does not look at tables...
VBA Code:
Sub DeleteRows1()
Dim x As Long
Dim iCol As Integer
iCol = 2 'Filter all on Col B
For x = Cells(Cells.Rows.Count, iCol).End(xlUp).Row To 2 Step -1
If Cells(x, iCol).Value < Date - 30 Then
Cells(x, iCol).EntireRow.ClearContents
End If
Next
End Sub