I have names in in Col F that I would like to delete containing
Queens
East
North
Port
William
However, when running my code, the rows containing this text is not deleted
It would be appreciated if someone could assist me
Sub Delete_Unwanted_Data()
Sheets("Data").Select
Dim LR As Long, i As Long
LR = Cells(Rows.Count, "F").End(xlUp).Row
For i = LR To 1 Step -1
If InStr((Cells(i, "F")), "Queens") = 1 Or InStr((Cells(i, "F")), "William") = 1 Or InStr((Cells(i, "F")), "Port") = 1 _
Or InStr((Cells(i, "F")), "North") = 1 Or InStr((Cells(i, "F")), "East") = 1 Then Rows(i).EntireRow.Delete
Next i
End Sub
Bookmarks