found this for you..
Ole P. Erlandsen wrote on April 27, 2003 04:29 EST
If you want to use functions from the Analysis Tool Pack addin in your
own macros:
- Open the VBE (Alt+F11).
- Activate the project where you want to use the function(s).
- Select Tools, References... and check the option atpvbaen.xls.
- click the OK-button to close the References-dialog.
The macros in the workbook where you added the reference to the
atpvbaen.xls library can now use the functions like this:
workdaycount = networkdays(Date, Date + 14)
Or like this to avoid conflict with other user defined functions with
the same name:
workdaycount = [atpvbaen.xls].networkdays(Date, Date + 14)
It is not necessary to install the Analysis Tool Pack addin from the
menu Tools, Add-Ins...
The DATE() and YEAR() worksheet functions are not necessary in VBA where
you use the built-in functions Date and Year:
Today = Date
Tomorrow = Date + 1
CurrentYear = Year(Date)
NextYear = Year(Date) + 1
keepITcool
< email : keepitcool chello nl (with @ and .) >
< homepage:
http://members.chello.nl/keepitcool >
archangel said:
how do I use a function from an addin in my vba code. For example, I
have the "Analysis ToolPak - VBA" addin installed and I want to do
something like:
NumOfDays = worksheetfunction.networkdays(startdate,enddate,myrange)
this line of code doesn't work because networkdays is in the
"Analysis ToolPak - VBA" addin, not the standard worksheet functions.