Sub
test()
Dim
SourceRange
As
Range, CompareRange
As
Range, SourceCell
As
Range, CompareCell
As
Range, i
As
Integer
Set
SourceRange = Tabelle6.Range(
"C8:AN8,C10:AN10"
)
Set
CompareRange = Tabelle7.Range(
"C8:AN8,C10:AN10"
)
For
Each
SourceCell
In
SourceRange
Set
CompareCell = CompareRange.Find(SourceCell.Value, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=
True
)
If
CompareCell
Is
Nothing
Then
SourceCell.Interior.ColorIndex = 3
Else
SourceCell.Interior.ColorIndex = 4
For
i = 1
To
0
SourceCell.Offset(0, i).Interior.ColorIndex = IIf(SourceCell.Offset(0, i).Value = CompareCell.Offset(0, i).Value, 3, 6)
Next
End
If
Next
End
Sub