I thought I'd solved this problem with the help of answers here but I'm still only deleting every second row that needs deleting. The loop is:
For Each row In ActiveSheet.UsedRange.Rows
'test for v in cell f and delete if there isn't one
str = Cells(row.row, "F").Value
Debug.Print "str is " & str
If InStr(1, str, "V") <> 0 Then
Debug.Print "hello str is " & str
Else
row.Delete Shift:=xlUp
End If
Next row
But when I run it on the following rows:
M 1301
M 1302
M 1401
ES 1501
M 1501
M 1502
MV 1502
M 1503
MV 1503
I end up with:
M1301 PMH
M1401 Rod Washer
M1502 Rod Washer
MV1502 Rod Washer
MV1503 Rod Washer
I feel like I'm going crazy. I had an incrementing counter in the loop as well and thought that was the problem but I still have it even though I've stopped using the counter to reference rows.
Any help in pointing out what I assume is obvious would be much appreciated.
Thanks