Danke für die Tipps.
Ich habe einmal eine variable Liste der Feiertage für ein beliebiges Jahr erstellt. Diese würde ich jetzt in einem Array ablegen und dann in einer Schleife abfragen und markieren:
[code]Sub feiertage()
Dim a As Long, b As Long, c As Long, d As Long, e As Long, f As Long
Dim OsterSo As Date
'
' Wurde kein Jahr angegeben, wird das aktuelle Jahr verwendet:
If Jahr = 0 Then
Jahr = Year(Now)
End If
' Die "magische" Gauss-Formel anwenden:
a = Jahr Mod 19
b = Jahr \ 100
c = (8 * b + 13) \ 25 - 2
d = b - (Jahr \ 400) - 2
e = (19 * (Jahr Mod 19) + ((15 - c + d) Mod 30)) Mod 30
If e = 28 Then
If a > 10 Then
e = 27
End If
ElseIf e = 29 Then
e = 28
End If
f = (d + 6 * e + 2 * (Jahr Mod 4) + 4 * (Jahr Mod 7) + 6) Mod 7
OsterSo = DateSerial(Jahr, 3, e + f + 22)
i = 1
Cells(i, 2) = DateSerial(Jahr, 1, 1)
Cells(i, 3) = "Neujahr"
i = i + 1
Cells(i, 2) = DateAdd("d", -2, OsterSo)
Cells(i, 3) = "Karfreitag"
i = i + 1
Cells(i, 2) = DateSerial(Jahr, 3, e + f + 22)
Cells(i, 3) = "Ostersonntag"
i = i + 1
Cells(i, 2) = DateAdd("d", 1, OsterSo)
Cells(i, 3) = "Ostermontag"
i = i + 1
Cells(i, 2) = DateSerial(Jahr, 5, 1)
Cells(i, 3) = "1.Mai"
i = i + 1
Cells(i, 2) = DateAdd("d", 39, OsterSo)
Cells(i, 3) = "ChristiHimmelfahrt"
i = i + 1
Cells(i, 2) = DateAdd("d", 49, OsterSo)
Cells(i, 3) = "Pfingstsonntag"
i = i + 1
Cells(i, 2) = DateAdd("d", 50, OsterSo)
Cells(i, 3) = "Pfingstmontag"
i = i + 1
'Cells(i, 2) = DateAdd("d", 60, OsterSo)
'Cells(i, 3) = "Fronleichnam"
'i = i + 1
'Cells(i, 2) = DateSerial(Jahr, 12, 25) - Weekday(DateSerial(Jahr, 12, 25), vbMonday) - 4 * 7 - vbWednesday
'Cells(i, 3) = "BußundBetTag"
'i = i + 1
Cells(i, 2) = DateSerial(Jahr, 10, 3)
Cells(i, 3) = "TagDerEinheit"
i = i + 1
Cells(i, 2) = DateSerial(Jahr, 10, 31)
Cells(i, 3) = "Reformationstag"
i = i + 1
Cells(i, 2) = DateSerial(Jahr, 12, 25)
Cells(i, 3) = "1.Weihnachsfeiertag"
i = i + 1
Cells(i, 2) = DateSerial(Jahr, 12, 26)
Cells(i, 3) = "2.Weihnachsfeiertag"
i = i + 1
End Sub[/code]
Gruß A.