+ Reply to Thread
Results 1 to 5 of 5

VBA Calendar Help-Holidays

  1. #1
    Registered User
    Join Date
    06-22-2017
    Location
    New York
    MS-Off Ver
    2010
    Posts
    6

    VBA Calendar Help-Holidays

    Hello,

    I have posted before about a calendar but I have a different question now. I have a calendar (attached) that has a different month on every sheet (2 years worth). The dates automatically populate based off the year entered in cell 'January!K14'. On the 25th sheet labeled 'Holidays' there is a list of Holiday names and two columns with formulas to derive the dates of each holiday. What I would like to do with VBA is take the name of the holiday and place it in the appropriate day on the calendar. For example, in 2017 Thanksgiving is on 11/23/2017. I would like cell 6 rows below the date title ('November!E46') to automatically populate with the text in cell 'Holidays!A9' because 'Holiday!B9' is equal to 'November!E40'.

    Any help would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,936

    Re: VBA Calendar Help-Holidays

    Add this macro to your workbook in a standard code module, and save as a .xlsm file:

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    06-22-2017
    Location
    New York
    MS-Off Ver
    2010
    Posts
    6

    Re: VBA Calendar Help-Holidays

    Bernie,

    Thank you for responding so quickly! I am having issues getting this to work. Any suggestions? Could you also throw in some comments so I can follow what it should be doing?

    Thanks,
    Drew

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,936

    Re: VBA Calendar Help-Holidays

    Here is a file, with modified and commented code (missed that my original code might find 11/25 instead of 12/25 for December) and code to clear the labels when you update the calendar to new years.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-22-2017
    Location
    New York
    MS-Off Ver
    2010
    Posts
    6

    Re: VBA Calendar Help-Holidays

    That is perfect! Thank You.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to Create Interactive calendar which displays country wise holidays
    By ErgoTeam in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-24-2017, 07:28 PM
  2. [SOLVED] Trying to add holidays to existing formula for calendar.
    By MrOchoa in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-24-2016, 06:46 AM
  3. Auto Populate Holidays in a Calendar
    By popeye000 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-02-2016, 03:39 PM
  4. [SOLVED] Account for holidays in an automated calendar
    By Lizzietish11 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-24-2014, 10:13 AM
  5. Replies: 2
    Last Post: 12-05-2012, 07:01 AM
  6. Counting calendar days, omitting holidays
    By Jackal in forum Excel General
    Replies: 5
    Last Post: 05-01-2008, 03:20 PM
  7. Generating business days in a calendar month, EXCLUDING holidays
    By jacob in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-12-2005, 12:06 AM

Tags for this Thread

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