Hallo Mr.K
Ich setze nur andere Ideen neu zusammen!
Erstversion!
Sub BerechneOsterdatum()
Dim Jahr As Integer
Jahr = InputBox("Geben Sie das Jahr ein:")
Dim a As Integer, b As Integer, c As Integer, d As Integer, e As Integer, f As Integer, g As Integer, h As Integer, i As Integer, k As Integer, L As Integer, m As Integer, p As Integer
a = Jahr Mod 19
b = Jahr \ 100
c = Jahr Mod 100
d = b \ 4
e = b Mod 4
f = (b + 8) \ 25
g = (b - f + 1) \ 3
h = (19 * a + b - d - g + 15) Mod 30
i = c \ 4
k = c Mod 4
L = (32 + 2 * e + 2 * i - h - k) Mod 7
m = (a + 11 * h + 22 * L) \ 451
p = (h + L - 7 * m + 114) \ 31
Dim Tag As Integer
Tag = (h + L - 7 * m + 114) Mod 31 + 1
Dim Monat As Integer
Monat = p
Dim Wochentag As String
Dim Ostersonntag As Date
Ostersonntag = DateSerial(Jahr, Monat, Tag)
Wochentag = Format(Ostersonntag, "dddd")
MsgBox "Ostersonntag im Jahr " & Jahr & " ist am " & Tag & ". " & Monat & ". (" & Wochentag & ")"
End Sub
|