View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
faisal QADEER faisal QADEER is offline
external usenet poster
 
Posts: 2
Default Excel2000 VBA: First workday of month

try using the eomonth function then +1
also you may need to nest in a vlookup if statement to check whether that
date returned is holiday (from the list of holiday dates).

"Arvi Laanemets" wrote in message
...
Hi

What is the best way to calculate 1st workday of any month (holidays must
be
counted too)?

At moment I have a solution, where a list of dates for some amount of
years
is created, with additional column where all dates are labeled as
"workday",
"weekend", or "holiday". The code is looking for 1st workday in this list,
starting from 1st of month.

Probably a slightly better solution will be, where the list contains only
holidays. The code will be look for 1st date to be not weekend and not
present in holidays list in given month.

On worksheet, I can easily calculate the 1st workday of month using
WORKDAY
function {=WORKDAY(DATE(Year, Month, 0),1,Holydays)}. But it seems, that I
can't use functions from Analysis Toolpack in VBA! Am I right about this,
or
is there a way?


Arvi Laanemets