Hi,
I need a little help with the code I have created. I am trying to delete all rows that do not contain the following strings in them. Sorry if it's a little dirty and does not work, but this shows the gist of what I'm trying to do.
Thank you
Sub TestFilter()
Set ws = Sheets("Sheet1")
lastRow = ws.Range("A" & ws.Rows.Count).End(xlUp).Row
Set rng = ws.Range("E1:AA" & lastRow)
With rng
.AutoFilter 1, "<>* BH", xlOr, "<>* BR", xlOr, "<>* CH", xlOr, "<>* TX", xlOr, "<>* TS", xlOr, "<>* MO", xlOr, "<>* NY", xlOr, "<>* WD"
.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
End With
ws.AutoFilterMode = False
End Sub
Bookmarks