title: Excel VBA check multiple values in a cell
body: <p>I am trying to make a macro that checks a column for specific values.
  I tried my hands on it. It checks for the specific values but the problem is it checks only single value.</p>
  
  <p>For example - Suppose there are three cells.</p>
  
  <pre><code>Cell 1 contains Red
  Cell 2 contains Black
  Cell 3 contains Red;Black 
  </code></pre>
  
  <p>After running the macro Cell 3 is highlighted.</p>
  
  <p>Although i have added both the colors in array but it is checking for exact match.</p>
  
  <pre><code>    Cells.Find(What:="Color Filter", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
          :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
          False, SearchFormat:=False).Activate
  
     Dim myarray As Variant
  
     Dim r As Variant
  
     myarray = Array("Beige", "Black", "Blue", "Brown", "Cream", "Green", "Grey", "Maroon", "Multi", "Orange", "Pink", "Purple", "Red", "Rust", "Turquoise", "Violet", "White", "Wine", "Yellow", "Transparent")
  
  Dim Rng As Range
  
  Dim Dn As Range
  
  Set Rng = Range(Cells(MyRow, MyCol), Cells(LastRow, MyCol))
  
      For Each Dn In Rng
  
      For Each r In myarray
  
          If Dn = r Then
  
              Dn.Interior.ColorIndex = xlNone
  
          Exit For
  
     ElseIf Dn = "" Then
  
     Dn.Interior.ColorIndex = 3
  
           Else
              Dn.Interior.ColorIndex = 3
  
      End If
  
      Next r
  
  Next Dn
  </code></pre>