I'm trying to delete entire row if cell in column I is NOT like "*loenn*" or not like "*lott*".
Both wildcard search and multiple conditions if to delete row.
Tried this:
... but it deletes ALL rows!
Anyone that knows how I can get this vba to work?
And is there perhaps a way to to this faster? Maybe autofilter (I've never used this function)?
Both wildcard search and multiple conditions if to delete row.
Tried this:
Code:
Last = Cells(Rows.Count, "A").End(xlUp).Row
For i = Last To 2 Step -1
If ((Cells(i, "I").Value <> "*loenn*") Or _
(Cells(i, "I").Value <> "*lott*")) Then
Cells(i, "I").EntireRow.Delete
End If
Next i
... but it deletes ALL rows!
Anyone that knows how I can get this vba to work?
And is there perhaps a way to to this faster? Maybe autofilter (I've never used this function)?
Last edited: