Besides the fact that I'm stupid.
I'm trying to delete all rows in which "K" column value is less then 30.
Sub Delete()
For lRow = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -1
If Value(Cells(lRow, "K")) < 30 Then
Rows(lRow).DELETE
End If
Next lRow
End Sub
Also, why some macros are so slow?
I have about 3000 rows in my file and only want to see data from today (about only 100 rows), so I use same formula to delete all that is not from today (it works, but very slow and I get an error at the end, but it still works):
BUT IT IS SOOOOOOO SLOW. Anybody knows why? Is there a better way?
Sub onlycurrent()
For lRow = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -1
If Value(Cells(lRow, "M")) < DateValue(Now()) Then
Rows(lRow).DELETE
End If
Next lRow
End Sub
Bookmarks