View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Function for calculating workdays?

On Sun, 12 Oct 2003 12:24:10 +0100, "Bob Phillips"
wrote:

Thorleif,

NETWORKDAYS is part of the Analysis Toolpak addin, and as such you cannot
use it in VBA as you would the built-in functions.

However, it is still possible to use it. In VBA, go to ToolsReferences, and
check the ATP library. In English it's called ATPVBAEN.XLS.

Then you call the function as for any other function, such as
Msgbox NetWorkdays(.....)


One further comment. The ATP function WORKDAY is very US-centric with regard
to date interpretation. It may be that NETWORKDAYS is also US-centric. If
that is the case, and TC is not using the US date format, NETWORKDAYS may not
function properly for him. I recall a French poster having a date related
problem with the WORKDAY function, and we wound up writing a VBA routine that
did not involve the ATP.


--ron