80 - Recursion in VBA (find the next valid day)

Published: 25 July 2024
on channel: WesleySon
52
1

Making a recursive function that will take a date, add X days to it and find the first non-weekend non-holiday
If the function outputs 23/12/2023 (saturday + holiday), it will spit out 27/12/2023 - the first non-weekend non-holiday.


00:00 Find first non-vacation non-weekend day
00:37 Sub to test
01:08 AddXDays, check the input is a date
03:17 Holidays as an array
04:00 Variables
04:45 Check for weekends
05:28 Loop through holidays
06:12 Recursive function call
06:35 Test #1
06:43 Debugging
07:11 Stepping through the function
08:30 Using the function in a sheet
08:42 Wrong formatting
09:59 Subs can change the cell formatting


Watch video 80 - Recursion in VBA (find the next valid day) online without registration, duration hours minute second in high quality. This video was added by user WesleySon 25 July 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 52 once and liked it 1 people.