need help with a vba macro that i have
Sub CF_Applied()
'create key index Range("K2:N5")
sr = 2
sc = 11
Key = ""
For r = 0 To 3
For c = 0 To 3
x = Cells(sr + r, sc + c).Interior.ColorIndex
If x = -4142 Then x = 0 Else x = 1
Key = Key & x
Next c
Next r
'the above defines the range for the Key (Mask) to match
sc = 5
For l = 2 To Cells(Rows.Count, "E").End(xlUp).Row Step 7
key1 = ""
For r = 0 To 3
For c = 0 To 3
target = Cells(l + r, sc + c)
Z = WorksheetFunction.CountIf(Range(Cells(l, sc), Cells(l + 4, sc + 4)), target)
If Z = 1 Then x = 0 Else x = 1
key1 = key1 & x
Next c
Next r
If key1 = Key Then Cells(l, sc - 1) = "Match" Else Cells(l, sc - 1) = ""
Next l
End Sub
Solved by S. H. in 12 mins