hier eine Beispieldatei
https://www.herber.de/bbs/user/73185.xls
danke für hilfeleistung ;-)
gruß
robert
Sub Farbe()
Dim Zei As Long, arrF
arrF = Array(3, 10, 20, 30, 40, 50)
On Error Resume Next
For Zei = 2 To Cells(Rows.Count, 1).End(xlUp).Row
Cells(Zei, 3).Resize(1, 3).Interior.ColorIndex = arrF(Year(Cells(Zei, 3)) - 2006)
Cells(Zei, 6).Resize(1, 3).Interior.ColorIndex = arrF(Year(Cells(Zei, 6)) - 2006)
Next Zei
End Sub
Sub Farbe()
Dim Zei As Long, arrF, Letzte As Long
arrF = Array(3, 10, 20, 30, 40, 50)
Letzte = Cells(Rows.Count, 1).End(xlUp).Row
On Error Resume Next
Range(Cells(2, 3), Cells(Letzte, 8)).Interior.ColorIndex = xlNone
For Zei = 2 To Letzte
Cells(Zei, 3).Resize(1, 3).Interior.ColorIndex = arrF(Year(Cells(Zei, 3)) - 2006)
Cells(Zei, 6).Resize(1, 3).Interior.ColorIndex = arrF(Year(Cells(Zei, 6)) - 2006)
Next Zei
End Sub