I need a VBA sub to find the day number for the first working Monday in the month and to enter the value into cells C5 to C49 as appropriate.
Cells C5 to C49 will be populated with the day number appropriate to the item described in cells F5 to F49 either by VBA or by direct entry, as required. The values act as a seed to calculate the values for cells A5 to A49 and B5 to B49. The reason for doing it this way is outside the scope of this problem and way too complex to describe here. Please just accept it as it is.
Cell B4 on the active sheet contains the date for the first of the month. For example 01-05-2021 (using dd-mm-yyyy format) is entered as 01-05-2021 rather than being derived from a formula.
The list of the public holidays for the current year is held in cells A1:A11 on a separate sheet named “Holidays”.
If the first Monday in the month is a public holiday then I need the day number for the previous Friday, or, in the case of Easter Monday, that for the previous Thursday.
The workday.Intl seems to fit the bill but I am getting a plethora of meaningless and confusing error messages and nothing that even remotely works.
The first problem is trying to establish the difference is between Workday_Intl and Workday.Intl, is it a "_" or a dot. The results from Web searches seem to use them interchangeably. What is the difference? Is there one?
Sub routines or code fragments that purport to work copied from such pages just give errors.
I need a fresh pair of eyes on the problem as I am currently going round in circles.
Can anybody help?
Many thanks
Tegglet
Bookmarks