Fing a specific string in a Cell
Try (but backup data beforehand!):
Sub x()
Dim lastrow As Long, i As Long
With worksheets("Sheet1")
lastrow = .Cells(Rows.Count, "E").End(xlUp).Row
For i = lastrow To 1 Step -1
If Application.And(.Cells(i, "E") < "", InStr(1, .Cells(i, "E"),
"Account") = 0, InStr(1, .Cells(i, "E"), "New") = 0) Then
Rows(i).EntireRow.Delete
End If
Next i
End with
End Sub
" wrote:
I would like to search all the cells that are not empty in column E for
the words Account and New. If the cell does not have either of those
words in it, I would like to delete that entire row, go to the next
cell in column E and repeat this action until I arrive at an empty
cell.
Please help
LP
|