markman235
Board Regular
- Joined
- May 10, 2011
- Messages
- 52
Hi everyone,
I am to write a macro for Excel 365 that will look at a date and delete the row if it is greater than today. I found one that was from a few years ago online, but it doesn't seem to work.
The date is in column F
Sub delfutureDays()
Dim cl As Long
For cl = Range("F2").End(xlDown).Row To 2 Step -1
If Cells(cl, "F") > Date Then Rows(cl).EntireRow.Delete
Next
End Sub
Any thoughts?
Mark
I am to write a macro for Excel 365 that will look at a date and delete the row if it is greater than today. I found one that was from a few years ago online, but it doesn't seem to work.
The date is in column F
Sub delfutureDays()
Dim cl As Long
For cl = Range("F2").End(xlDown).Row To 2 Step -1
If Cells(cl, "F") > Date Then Rows(cl).EntireRow.Delete
Next
End Sub
Any thoughts?
Mark