|
Sub lll()
Dim i As Integer, j As Integer, k As Integer, m As Integer, n As Integer, h As Integer, g As Integer
Dim sht As Worksheet
Dim arr
Dim dic As New Dictionary
Set sht = Worksheets("sheet1")
i = sht.Cells(Rows.Count, 1).End(xlUp).Row
arr = Range("g4:k" & i)
For j = 1 To UBound(arr)
For k = 1 To 5
If arr(j, k) <> "" Then
dic.Item(arr(j, k)) = ""
End If
Next
Next
For m = 0 To dic.Count - 1
If Application.WorksheetFunction.CountIf(Range("g4:k" & i), dic.Keys(m)) > 1 Then
n = n + 2
For h = 4 To i
For g = 7 To 11
If Cells(h, g).Value = dic.Keys(m) And Application.WorksheetFunction.CountIf(Range(Cells(4, g), Cells(i, g)), Cells(h, g)) = 1 Then
Cells(h, g).Interior.ColorIndex = n
End If
Next
Next
End If
Next
End Sub
|
|