A
AOP
I have the following code which deletes all entries that are one year old to
date.
Private Sub deleteit()
Dim LastRow As Long
Dim X
LastRow = Range("A20000").End(xlUp).Row
For X = LastRow To 1 Step -1
If Cells(X, 1).Value < Date - 365 Then
Range("A" & X & "" & X).ClearContents
End If
Next
End Sub
This code works well, but what I need is only to clear columns A to F and H.
I need it to leave column G alone because it has formulas.
date.
Private Sub deleteit()
Dim LastRow As Long
Dim X
LastRow = Range("A20000").End(xlUp).Row
For X = LastRow To 1 Step -1
If Cells(X, 1).Value < Date - 365 Then
Range("A" & X & "" & X).ClearContents
End If
Next
End Sub
This code works well, but what I need is only to clear columns A to F and H.
I need it to leave column G alone because it has formulas.