View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
thomas donino thomas donino is offline
external usenet poster
 
Posts: 89
Default vba coding question

thank you

"Ron Rosenfeld" wrote:

On Mon, 10 Aug 2009 14:47:02 -0700, thomas donino
wrote:

I have a date in a cell which I need to check for whether or not it is a
weekend day or a holiday. I have a function to do each, my question is how do
I construct the loop to check first if its a weekend day and if so run again
to see if the day prior is a weekend day and then if that is also a weekend
day to check if day prior again is a holiday. If it is, return the next prior
day and if not then return that day. I already built the Isweekend and
Isholiday functions.

Thank you in advance


Excel has this function either built-in (Excel 2007+) or as part of the
analysis tool pack.

For a worksheet function, with your date to process in A1, and Holidays being a
named range of holiday dates, merely use:

=WORKDAY(A1+1,-1,Holidays)

--ron