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 hRow = Application...
, I receive an error that The application does not support this object or property.
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.
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" & i).Text, LookUpRange, 0)
If Not IsNull(hRow) Then
compare.Range("C" & i).Interior.Color = LookUpRange.Range("C" & hRow).Interior.Color
End If
Next i
End Sub
Worksheets("Full List")
afterApplication
However I would take a different approach... I would use.Find
and.Findnext
– Siddharth RoutWorksheets("Full List")
resulted in the errorUnable to get the Match property of the WorksheetFunction class
– tmoore82