Sub
zusammenfassen()
Dim
ws
As
Worksheet
Dim
lastRow
As
Long
Dim
i
As
Long
Dim
Kombination
As
String
Dim
dict
As
Object
Dim
FarbeGelb
As
Long
Dim
FarbeHellgrau
As
Long
Set
ws = ThisWorkbook.Sheets(
"XXXX"
)
lastRow = ws.Cells(ws.Rows.Count,
"E"
).
End
(xlUp).Row
Set
dict = CreateObject(
"Scripting.Dictionary"
)
FarbeGelb = RGB(255, 255, 0)
FarbeHellgrau = RGB(192, 192, 192)
For
i = 2
To
lastRow
Kombination = ws.Cells(i,
"A"
).Value &
"|"
& _
ws.Cells(i,
"E"
).Value &
"|"
& _
ws.Cells(i,
"F"
).Value &
"|"
& _
ws.Cells(i,
"G"
).Value &
"|"
& _
ws.Cells(i,
"H"
).Value &
"|"
& _
ws.Cells(i,
"I"
).Value
If
dict.exists(Kombination)
Then
ws.Cells(i,
"C"
).Interior.Color = FarbeGelb
ws.Cells(i,
"F"
).Interior.Color = FarbeGelb
ws.Cells(i,
"N"
).Interior.Color = FarbeGelb
ws.Cells(dict(Kombination),
"C"
).Interior.Color = FarbeGelb
ws.Cells(dict(Kombination),
"F"
).Interior.Color = FarbeGelb
ws.Cells(dict(Kombination),
"N"
).Interior.Color = FarbeGelb
Else
ws.Cells(i,
"C"
).Interior.Color = FarbeHellgrau
ws.Cells(i,
"F"
).Interior.Color = FarbeHellgrau
ws.Cells(i,
"N"
).Interior.Color = FarbeHellgrau
dict.Add Kombination, i
End
If
Next
i
Set
dict =
Nothing
End
Sub