it took 1 second.
change worksheet name, ranges, row and column numbers to suit
Sub FindAndWriteColorPatterns_VBAX_52267()
Dim ArrColors, ArrPattern(1 To 210)
Dim r As Long, c As Long, calc As Long
Dim ColorString As String
With Application
.DisplayAlerts = False
.ScreenUpdating = False
.EnableEvents = False
calc = .Calculation
.Calculation = xlCalculationManual
End With
With Worksheets("VBA Test") 'change worksheet name to suit
'write interior color values to cells
For r = 3 To 212 'change start and end row numbers to suit
For c = 10 To 15 'change start and end column numbers to suit
.Cells(r, c) = .Cells(r, c).Interior.Color
Next c
Next r
'load pattern cells' interior colors into 2D array
ArrColors = .Range("J3:O212").Value 'change range to suit
'create a 1D array, each element being concatenation of each 'row' of ArrColors
For r = 1 To 210
ArrPattern(r) = Join(Application.Index(ArrColors, r, 0), "|")
Next r
'since interior color values are stored in 2D array clear them
.Range("J3:O212").ClearContents
'clear existing match numbers, if any
.Range("G3:G" & .Cells(.Rows.Count, 1).End(xlUp).Row).Clear 'Last Cell in Col A must not be blank
'write matches to Col G | No match returns #N/A
For r = 1 To .Cells(.Rows.Count, 1).End(xlUp).Row 'Last Cell in Col A must not be blank
ColorString = ""
For c = 1 To 6
ColorString = ColorString & .Cells(r, c).Interior.Color & "|"
Next c
ColorString = Left(ColorString, Len(ColorString) - 1) 'remove trailing "|" character added by last iteration
.Cells(r, c) = Application.Match(ColorString, ArrPattern, 0)
Next r
End With
With Application
.EnableEvents = True
.Calculation = calc
End With
End Sub