Can any one see why in vba a for each doesn't catch all rows that meet the if statement condition? This simple method below will delete a row if it contains cells with a length of 3. It deletes some but not all but will eventually delete all if I keep running it.
Sub delete_3Digit_Numbers()
For Each cell In Selection
If cell.Value <> "" And Len(cell.Value) = 3 Then
Rows(cell.Row).EntireRow.Delete
End If
Next cell
End Sub
UnionRange and delete its rows at once of the code end. In such a loop, after row deletion, the reference for the next one is lost...