Hello,
I am programming a spreadsheet that automatically populates a timeline based on a number of different factors. One of these factors is which factory will produce the desired product. Each of these factories have different holidays so depending on which factory is selected from a validation menu, the corresponding list of holidays will be used to exclude from the timeline. I was able to get this to work using static ranges for the holidays for each of the factories, however I was hoping that people could add holidays as they came up so I wanted to make the range dynamic.
This is what I have named the dynamic range within the Sheet:
All_FL_Holidays = OFFSET(Sheet2!$Z$2,0,0,MATCH("*",Sheet2!$Z:$Z,-1),1)
Now, my dilemma is that when I try to use this code:
Case "FL"
Range("E21").Value = SixDayWeek(Range("E22"), 10, Range("All_FL_Holidays"))
'(The function SixDayWeek has the syntax: SixDayWeek(StartDate, # of days later, Holidays)
the timeline does not update for different factories, however I do not get any error messages. However, when I change "All_FL_Holidays" to a static list (Z2 : Z20) and I play with timeline, the dates do update. So, I was wondering if I have to use something other than "Range" in the Macro because it seems to me that "Range" only works with static ranges defined in the Sheet. Any help would be greatly appreciated.
-Zeke
Bookmarks