Hallo Community
Zum ergänzen
Datum unf Name laufen Parallel
2 Datum ist der 2 Name
5 Datum ist der 5 Name etc.
Zelle ist ein Datum
Function Feiertag2(Zelle As Date) As String
Dim DatumString As String
Dim IntYear As Integer, OsterDatum As Integer
IntYear = Year(Zelle)
OsterDatum = (((255 - 11 * (IntYear Mod 19)) - 21) Mod 30) + 21
DatumString = _
DateSerial(IntYear, 1, 1) & _
DateSerial(IntYear, 1, 6) & _
DateSerial(IntYear, 3, 1) + OsterDatum + (OsterDatum > 48) + 6 - ((IntYear + IntYear \ 4 + OsterDatum + (OsterDatum > 48) + 1) Mod 7) - 2 & _
DateSerial(IntYear, 3, 1) + OsterDatum + (OsterDatum > 48) + 6 - ((IntYear + IntYear \ 4 + OsterDatum + (OsterDatum > 48) + 1) Mod 7) & _
DateSerial(IntYear, 3, 1) + OsterDatum + (OsterDatum > 48) + 6 - ((IntYear + IntYear \ 4 + OsterDatum + (OsterDatum > 48) + 1) Mod 7) + 1 & _
DateSerial(IntYear, 5, 1) & _
DateSerial(IntYear, 3, 1) + OsterDatum + (OsterDatum > 48) + 6 - ((IntYear + IntYear \ 4 + OsterDatum + (OsterDatum > 48) + 1) Mod 7) + 39 & _
DateSerial(IntYear, 3, 1) + OsterDatum + (OsterDatum > 48) + 6 - ((IntYear + IntYear \ 4 + OsterDatum + (OsterDatum > 48) + 1) Mod 7) + 50 & _
DateSerial(IntYear, 3, 1) + OsterDatum + (OsterDatum > 48) + 6 - ((IntYear + IntYear \ 4 + OsterDatum + (OsterDatum > 48) + 1) Mod 7) + 60 & _
DateSerial(IntYear, 10, 3) & _
DateSerial(IntYear, 11, 1) & _
DateSerial(IntYear, 12, 24) & _
DateSerial(IntYear, 12, 25) & _
DateSerial(IntYear, 12, 26) & _
DateSerial(IntYear, 12, 31) & _
"31.10.2017"
FName = Array("Neujahr", "Dreikönig", "Karfreitag", "Ostersontag", "Ostermontag", "Tag der Arbeit", "Christi Himmelfahrt", "Pfingstmontag", "Fronleichnam", "Tag der Einheit", "Allerheiligen", "Heiligabend", "1. Weihnachtstag", "2. Weihnachtstag", "Silvester", "Reform")
If InStr(DatumString, Zelle) > 0 Then Feiertag2 = FName(InStr(DatumString, Zelle) / 10)
End Function
|