D
David Macdonald
I've got a database sheet of about 3000 rows with a date column (values from
2004 up to yesterday).
When I run this:
If cell.Value < (CDate(Now) - 2) Then cell.Interior.ColorIndex = 6
all the cells up to three days ago turn yellow, as they should.
But when i run this:
If cell.Value < (CDate(Now) - 2) Then EntireRow.Delete
about half the rows are deleted but I still have hundreds of dates from
years ago.
I've tried splitting the "If" into:
If cell.Value < (CDate(Now) - 2) Then
EntireRow.Select
Selection.Delete
End if
but the result is the same.
Can anyone explain why I'm getting different results and how this apparently
random selection is taking place?
2004 up to yesterday).
When I run this:
If cell.Value < (CDate(Now) - 2) Then cell.Interior.ColorIndex = 6
all the cells up to three days ago turn yellow, as they should.
But when i run this:
If cell.Value < (CDate(Now) - 2) Then EntireRow.Delete
about half the rows are deleted but I still have hundreds of dates from
years ago.
I've tried splitting the "If" into:
If cell.Value < (CDate(Now) - 2) Then
EntireRow.Select
Selection.Delete
End if
but the result is the same.
Can anyone explain why I'm getting different results and how this apparently
random selection is taking place?