This code below working well to delete any rows that contain a date that is older than from the current month
Code: Select all
Option Explicit
Sub test()
Rows("1:2").Insert
[j2].Formula = "=j4<=eomonth(today(),-1)"
With Range("j3", Range("j" & Rows.Count).End(xlUp))
.AdvancedFilter 1, [j1:j2]
.Offset(1).EntireRow.Delete
.Parent.ShowAllData
End With
Rows("1:2").Delete
With Cells(1).CurrentRegion
With .Offset(1).Resize(.Rows.Count - 1).Columns(1)
.Value = Evaluate("row(1:" & .Rows.Count & ")")
End With
End With
End Sub
Here is what I currently have in my Module ... Thanks in advance.