Hi,
I'm trying to solve a problem i have with my macro code for deleting entire rows when cell values in column V
are between 23:00:00 and 08:00:00 o'clock. The cells in column V are formatted as 'time' and the number of rows in the sheet
must be able to change.
The code worked fine for another
similar sheet with time criteria between 19:00:00 and 08:00:00. I can't seem to figure out what the problem is here..
The code i have right now is:
Sub Delete_rows
Sheets("New").Select
For i = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row To 2 Step -1
If Cells(i, "V") > "23:00:00" And Cells(i, "V") < "8:00:00" Then
ActiveSheet.Cells(i, "A").EntireRow.Delete
Cells(i - 1, 1).Select
End If
Next i
End Sub
Can anyone help me with this one?
Thanks a lot!
Bookmarks