Sub ccp()
a = Cells(65536, 1).End(xlUp).Row
m = 3
For i = 1 To a
If m > 50 Then
m = 3
End If
For j = 1 To a
For k = 1 To a
If Cells(i, 1) = Cells(j, 2) And Cells(i, 1) = Cells(k, 3) Then
Cells(i, 1).Interior.ColorIndex = m
Cells(j, 2).Interior.ColorIndex = m
Cells(k, 3).Interior.ColorIndex = m
m = m + 1
End If
Next
Next
Next
End Sub