Captain_Conman
Board Regular
- Joined
- Jun 14, 2018
- Messages
- 54
Hello! I currently have a working macro that deletes all the rows that contain a date equal to or older than 6/1/18. However in coming weeks this date will change and I would like the macro to reference the most recent date found in a column E of a sheet called "Current" in the same workbook. This would then delete all the rows on Sheet 1 that have a date less than or equal to the most recent date that the macro references.
Hopefully my question is clear, and any help would be appreciated.
Here is my current code...
'Delete all old dates
With ActiveSheet
.AutoFilterMode = False
With Range("g1", Range("g" & Rows.Count).End(xlUp))
.AutoFilter 1, "<=6/1/18"
On Error Resume Next
.Offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
End With
Hopefully my question is clear, and any help would be appreciated.
Here is my current code...
'Delete all old dates
With ActiveSheet
.AutoFilterMode = False
With Range("g1", Range("g" & Rows.Count).End(xlUp))
.AutoFilter 1, "<=6/1/18"
On Error Resume Next
.Offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
End With