I've been working on a project and i am at the last step, what i want the last piece of code to do is delete all rows that do not start with 25, 26 or 27
For Each cell In Worksheets("Sheet2").Range("A:A")
If Left(CStr(cell.Value), 2) <> 25 And Left(CStr(cell.Value), 2) <> 26 And Left(CStr(cell.Value), 2) <> 27 Then
matchRow = cell.Row
Rows(matchRow & ":" & matchRow).Select
Selection.Delete Shift:=xlDown
The results are not as hoped: some cells still remain after running it. Ii think that with this method, when I delete a cell it shifts the cycle and it skips the next cell over.
How can i prevent this from happening?