if you want delete all rows except "string1" and "string2"
![]()
Sub test() With [a1].CurrentRegion .Columns(2).FormulaR1C1 = "=SUM(--((ISNUMBER(FIND(""string1"",rc[-1]))+ISNUMBER(FIND(""string2"",rc[-1])))>0))" 'change is needed .AutoFilter 2, "=0" '< change to 1 if want delete text contain "string1" and "string2" .Offset(1).SpecialCells(12).EntireRow.Delete .AutoFilter .Columns(2).Delete End With End Sub
Bookmarks