Using a Macro as a fuction

Happy_Dog

New Member
Joined
Apr 25, 2002
Messages
16
How can I call a vba function that I can use like the built in functions? for example I need the number of weekdays between two dates, similar to =DAYS360() which returns total number of days.
 
Mark,
I would like to know how do that anyway, so if you want to help figure that out I would appreciate it.

Thanks.
 
Upvote 0

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Happy_Dog

Networkdays does not work unless user has Analysis Toolpak installed. You can overcome this by installing it via code in your workbook.

To do this use, say, the Open event for the workbook to test whether or not it is installed. If not, install it:

- Open VBE (Alt+F11)
- double click ThisWorkbook
- in the code page, cut and past this

Private Sub Workbook_Open()
If AddIns("Analysis toolpak").Installed = False Then AddIns("Analysis toolpak").Installed = True
End Sub

Now, each time the workbook is opened it check to see if the toolpak is installed. If it is not, it will install it. This then permits the function to operate.

Any help?

Regards

Robb__
 
Upvote 0

Forum statistics

Threads
1,213,517
Messages
6,114,089
Members
448,548
Latest member
harryls

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top