Hi,
Since Excel2003 or Excel2007 (I am not sure) there is no calendar function anymore.
So the last few years I have been trying to, somehow, recreate that calendar.
The one I am using now works perfectly, but I need some help explaning a piece of code I retained from somewhere(?), but I can't break it down (so to speak).
I am using the following UDF-functions in VBA Excel2016:![]()
Please Login or Register to view this content.
This function is triggered by the following piece of code (see code in RED):![]()
Please Login or Register to view this content.
My question revolves around this piece of code: ((Day(p_dtThisDate) \ 7 + IIf(Day(p_dtThisDate) Mod 7 = 0, 0, 1)) * 7 + Format(p_dtThisDate, "w", vbTuesday))![]()
Please Login or Register to view this content.
If the date is set to 17-01-2022 (January 17th) then the following values are 'calculated':
VBA - Controls.jpg
It ends in a calendar that looks like this:
Calendar.jpg
If someone could help me out, that would be awesome!
Bookmarks