isladogs
MVP / VIP
- Local time
- Today, 01:25
- Joined
- Jan 14, 2017
- Messages
- 18,787
I mentioned this in another thread earlier today.
https://www.access-programmers.co.uk/forums/showthread.php?t=294618
The function below calculates Easter Sunday for any year.
Apparently, that is the first Sunday after the first ecclesiastical full moon that occurs on or after March 21.
And there was me thinking they just made it up every year ....
That's it!
The code is by Chip Pearson who is, in my view anyway, the Excel equivalent of Allen Browne.
I just made minor tweaks to use it in Access
Apparently its 'only' guaranteed to be correct between 1900 and 2368 - I've no idea why.
After that it doesn't always work
However, if you're planning to still be around in 2369, you've got plenty of time to modify the code .. and to post a new version here
If you've never checked Chip's site, I strongly recommend it.
He also has code to calculate other holiday dates (mainly USA such as Thanksgiving)
Lots of other 'goodies' such as 'Programming The VBA Editor' using the 'Microsoft Visual Basic For Applications Extensibility 5.3' reference library
http://www.cpearson.com/Excel/MainPage.aspx
https://www.access-programmers.co.uk/forums/showthread.php?t=294618
The function below calculates Easter Sunday for any year.
Apparently, that is the first Sunday after the first ecclesiastical full moon that occurs on or after March 21.
And there was me thinking they just made it up every year ....
Code:
Public Function GetEasterSunday(Yr As Integer) As Date
'Code taken from http://www.cpearson.com/excel/Easter.aspx
Dim D As Integer
D = (((255 - 11 * (Yr Mod 19)) - 21) Mod 30) + 21
GetEasterSunday = DateSerial(Yr, 3, 1) + D + (D > 48) + 6 - ((Yr + Yr \ 4 + D + (D > 48) + 1) Mod 7)
End Function
That's it!
The code is by Chip Pearson who is, in my view anyway, the Excel equivalent of Allen Browne.
I just made minor tweaks to use it in Access
Apparently its 'only' guaranteed to be correct between 1900 and 2368 - I've no idea why.
After that it doesn't always work
However, if you're planning to still be around in 2369, you've got plenty of time to modify the code .. and to post a new version here

If you've never checked Chip's site, I strongly recommend it.
He also has code to calculate other holiday dates (mainly USA such as Thanksgiving)
Lots of other 'goodies' such as 'Programming The VBA Editor' using the 'Microsoft Visual Basic For Applications Extensibility 5.3' reference library
http://www.cpearson.com/Excel/MainPage.aspx
Last edited: