Identifying Dates


Posted by Eileen Glover on August 16, 1999 2:58 PM

I'm attempting to write a macro that will delete a row if the first cell (column A) is not a date.

I have it written to the point that it will delete the row if the first cell does not equal TODAY's date, but I need to modify it to delete the first cell if it does not equal ANY date.

Any suggestions?



Posted by Chris on August 18, 1999 7:11 AM

Try putting this code in your loop:

On Error Resume Next
x = DateValue(ActiveCell.Value)
If Err.Number <> 0 Then
ActiveCell.EntireRow.Delete Shift:=xlUp
Else
ActiveCell.Offset(1, 0).Select
End If

Chris