title: Excel VBA: Match Cell Color
body: <p>I have a workbook with two sheets. On Sheet A, I have changed the interior color of some cells. I would like to find cells in Sheet B with matching text and set them to have the same interior color. However, when I get to <code>hRow = Application...</code>, I receive an error that <code>The application does not support this object or property.</code> I've been searching for similar functions, but I am not having any success finding a good way to match text without looping through each cell in a range.</p>
  
  <pre><code>Public Sub MatchHighlight()
  
  Dim lRow As Integer
  Dim i As Integer
  Dim hRow As Integer
  
  Dim LookUpRange As Range
  Set LookUpRange = Worksheets("HR - Highlight").Range("C2:C104")
  
  Dim compare As Range
  Set compare = Worksheets("Full List").Range("C2:C277")
  
  lRow = Worksheets("Full List").UsedRange.Rows.Count
  
  For i = 2 To lRow
  
      hRow = Application.Worksheets("Full List").WorksheetFunction.Match(compare.Range("C" &amp; i).Text, LookUpRange, 0)
  
      If Not IsNull(hRow) Then
  
          compare.Range("C" &amp; i).Interior.Color = LookUpRange.Range("C" &amp; hRow).Interior.Color
  
      End If
  
  Next i
  </code></pre>
  
  <p>End Sub</p>