I am trying to search column B and highlight all cells that contain text other than the words Flyer, Bulk Clearance, Eat In Season, Line Drive, Market Special, Push Item, and Weekender. I have it starting in the third row on purpose.
The code below works for just one word (Flyer), but I'd like the macro to be able to compare the text in the cell to the list of words mentioned above and highlight if the text differs from what is in the list.
Sub Orange()
Dim LR As Long, i As Long
LR = ActiveSheet.Range("B" & Rows.Count).End(xlUp).Row
For i = 3 To LR
With Range("B" & i)
If .Value <> "Flyer" Then .Cells.Interior.ColorIndex = 45
End With
Next i
MsgBox "The orange are not valid values."
End Sub
Split
based on a string of entries separate by|
or something is a good approach. You can then iterate those with aFor Each...
– Byron Wall=ISNUMBER(MATCH($B3, <range with word list>, 0))
or=COUNTIF(<range with word list>, $B3)
. – user4039065