Hello,
I am trying to create a macro that will go through column A and delete all the rows that do not contain multiple keywords. Each time the macro is executed, the amount of keywords can change and this is where I am getting held up. I would imagine that an array would have to be used but I only know how to input an exact amount of keywords and not a variation of keywords each time.
The keywords in the rows I need to remain can contain alpha characters, numbers, or special characters as well. The code I use to search through and delete all but a single keyword is below but I need to apply it to a broader spectrum of keywords. Any help would be greatly appreciated.
Sub DeleteNonKeywordRows()
Dim i As Long
Dim strSearch As String
strSearch = InputBox("Enter search string")
For i = Range("A" & Rows.Count).End(xlUp).Row To 2 Step -1
If Not Range("A" & i).Value Like "*" & strSearch & "*" Then Rows(i).Delete
Next i
End Sub
Bookmarks