Option
Explicit
Sub
Einfaerben()
Dim
wshBlatt
As
Worksheet
Dim
lngZeile
As
Long
Dim
i
As
Integer
Set
wshBlatt = Worksheets(
"Tabelle1"
)
With
wshBlatt
lngZeile = .Cells(Rows.Count, 1).
End
(xlUp).Row
For
i = 1
To
lngZeile
If
.Cells(i, 1) =
"x"
Then
.Cells(i, 1).Offset(1, 0).Interior.Color = vbGreen
.Cells(i, 1).Offset(2, 0).Interior.Color = vbGreen
End
If
If
.Cells(i, 1) =
"y"
Then
.Cells(i, 1).Offset(1, 0).Interior.Color = vbGreen
.Cells(i, 1).Offset(2, 0).Interior.Color = vbGreen
.Cells(i, 1).Offset(3, 0).Interior.Color = vbGreen
End
If
Next
i
End
With
End
Sub