|
Sub cyq()
Dim d As Object
Dim c As Range
Set d = CreateObject("scripting.dictionary")
With Worksheets("sheet2")
For Each c In .Range("a1:a" & .Range("a65536").End(xlUp).Row)
If Not d.exists(CStr(c) & CStr(c.Offset(0, 2)) & CStr(c.Offset(0, 3)) & _
CStr(c.Offset(0, 5)) & CStr(c.Offset(0, 6))) Then
d.Add CStr(c) & CStr(c.Offset(0, 2)) & CStr(c.Offset(0, 3)) & _
CStr(c.Offset(0, 5)) & CStr(c.Offset(0, 6)), ""
Else
c.Offset(0, 2).Resize(1, 5).Select
Selection.Interior.ColorIndex = 6
End If
Next
End With
End Sub
|
|