ну как-то так, примерно:
[vba]Код
Sub U_431()
Application.ScreenUpdating = False
u_1 = Cells(Rows.Count, "c").End(xlUp).Row
u_5 = Cells(Rows.Count, "f").End(xlUp).Row
Range("c4:c" & u_1).Interior.Pattern = xlNone
Range("f4:f" & u_5).Interior.Pattern = xlNone
u_4 = 0
For Each u_2 In Range("c4:c" & u_1)
u_3 = Application.Match(u_2, Range("f:f"), 0)
If Application.IsNumber(u_3) Then
u_4 = u_4 + 123
u_2.Interior.Color = 65412 + u_4
Range("f" & u_3).Interior.Color = 65412 + u_4
End If
Next
Application.ScreenUpdating = True
End Sub
[/vba]
а может так красивее:
[vba]Код
If Application.IsNumber(u_3) Then
u_4 = u_4 + 12345
u_2.Interior.Color = u_4
Range("f" & u_3).Interior.Color = u_4
End If
[/vba]