Results 1 to 7 of 7

VBA Sub to Find the Date of the First Working Monday in the Month

Threaded View

  1. #1
    Registered User
    Join Date
    12-21-2017
    Location
    Wokingham, England
    MS-Off Ver
    office 365 2013
    Posts
    46

    VBA Sub to Find the Date of the First Working Monday in the Month

    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
    Attached Files Attached Files
    Last edited by Tegglet; 10-20-2021 at 11:30 AM. Reason: Add attachment

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Find First Monday of the Month
    By Anarchus in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-06-2016, 04:33 AM
  2. Replies: 3
    Last Post: 10-11-2014, 09:04 PM
  3. Find every Monday in a month using VBA
    By EmmaO91 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-10-2014, 07:32 AM
  4. [SOLVED] Find monday preceeding given-date unless date is a monday
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-10-2012, 07:42 AM
  5. Replies: 0
    Last Post: 02-20-2012, 02:27 PM
  6. 1st Monday of a month in date range??
    By scwilly in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 04-25-2006, 11:49 PM
  7. Finding the date on the 'nth' Monday in this Month in this Year
    By agarwaldvk in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-17-2006, 05:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1