Nelson78
Well-known Member
- Joined
- Sep 11, 2017
- Messages
- 526
- Office Version
- 2007
Hello everybody.
I have 500k rows to check.
If cell "H" is not beginning for "CODE", then delete entire row.
How You can imagine, with a such amount of rows the process takes too long.
How can I speed up? May be with a REGEX strategy?
I have 500k rows to check.
If cell "H" is not beginning for "CODE", then delete entire row.
How You can imagine, with a such amount of rows the process takes too long.
How can I speed up? May be with a REGEX strategy?
Code:
Sub deleterows()
Dim rw As Long
With Worksheets(1)
For rw = .Cells(Rows.Count, "A").End(xlUp).Row To 2 Step -1
If Not Cells(rw, "H").Value Like "CODE*" Then
.Rows(rw).EntireRow.Delete
End If
Next rw
End With
End Sub