Hi,
I am having troubles deleting rows that contain future dates. I want to keep rows that have today's date and previous dates but delete all rows that have tomorrow's date and beyond. When I use the code below, it deletes only a few rows at a time. I have to keep hitting the macro button to complete the deletion.
Anyone out there that could help?
Sub Delete()
'**************************************************************'
'Display Only Today's Dates and Previous Dates'
Sheets("R149").Select
iRow = 4
Do Until Sheets("R149").Cells(iRow, 6) = ""
If Sheets("R149").Cells(iRow, 6) > Date Then
Selection.EntireRow.Delete
'Sheets("R149").Rows(iRow).Delete 'Delete Future Dates
iRow = iRow + 1
Else
iRow = iRow + 1
End If
Loop
'**************************************************************'
End Sub
Any Thoughts?
Thx,
Jim
I am having troubles deleting rows that contain future dates. I want to keep rows that have today's date and previous dates but delete all rows that have tomorrow's date and beyond. When I use the code below, it deletes only a few rows at a time. I have to keep hitting the macro button to complete the deletion.
Anyone out there that could help?
Sub Delete()
'**************************************************************'
'Display Only Today's Dates and Previous Dates'
Sheets("R149").Select
iRow = 4
Do Until Sheets("R149").Cells(iRow, 6) = ""
If Sheets("R149").Cells(iRow, 6) > Date Then
Selection.EntireRow.Delete
'Sheets("R149").Rows(iRow).Delete 'Delete Future Dates
iRow = iRow + 1
Else
iRow = iRow + 1
End If
Loop
'**************************************************************'
End Sub
Any Thoughts?
Thx,
Jim