+ Reply to Thread
Results 1 to 2 of 2

Generating output to a column for many ranges

  1. #1
    Registered User
    Join Date
    12-11-2007
    Posts
    15

    Generating output to a column for many ranges

    I have a vacation calendar for work that I'm trying to automate as best as possible.

    One of the annoying features is that every year, I have to go in and change all the holidays on the calendar. I'm trying to think of ways to automate the process to an extent.

    On the attached sheet, you can see that I have the holidays typed out and on each tab, the dates that show are actually in full date format, so I can test each date against my holidays and determine if that day is a holiday or not. Once I find that it is a holiday, I want to put an 'H' in the column for everyone so that it denotes it is a holiday.

    Lets just say for the first tab, January. I want to test all of my dates in B2:AF2 and see if any of those dates match the dates in L23:L32 and if they do match, put an H in the column and if they dont, do nothing.

    I could use about a million if statements to say if this day is a holiday, H, if not, blank, however that will bog the sheet down pretty bad.

    Can anyone show me a way that I can use one macro to test each date against my holiday range and generate the holiday in the actual calendar?

    It will make a bit more sense once you look at the sheet. Please let me know. Thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Generating output to a column for many ranges

    Here I used conditional formatting instead of a macro. Since your row two values are date values, I just checked using the MATCH FUNCTION if the date was in the holiday table and formatted the column accordingly instead of entering an "H" in the cell.

    Next, I used a second conditional formatting formula to check if the day of the week, row 21 is greater than or equal to 5, indicating a weekend and formatted with grey.
    Attached Files Attached Files
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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