Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have one function stored in a module of a workbook, I'll like to use it in
a different workbook. At the begining of the function I used the Public statement, do I need to do something else? I do keep open the source workbook. regards |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Change the name of the VBProject that contains the function from the default
"VBA Project" to something meaningful like "projMathStuff". To do this, open the project containing the function, go to the Tools menu in VBA, choose "VBA Project Properties" and change the value of the Name parameter. Now, to allow other workbooks to call that function, the other workbook needs to set a reference to the "projMathStuff" project. In the calling workbook, go back to the Reference dialog and put a check next to the "projMathStuff" item. With that reference in place, you can call the function as if it were built in to the workbook: Res = TheFucntion(1,2,3) If there is the possibility that more than one workbook may have a function named TheFunction, you can prefix the call with the library name. E.g.,. Res = projMathStuff.TheFunction(1,2,3) -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) "Gerardo" wrote in message ... I have one function stored in a module of a workbook, I'll like to use it in a different workbook. At the begining of the function I used the Public statement, do I need to do something else? I do keep open the source workbook. regards |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do you make the INFO("directory") function work? | Excel Worksheet Functions | |||
HOW TO MAKE A LIST OF WORK SHEET IN WORK BOOK IN EXCEL 2007 | Excel Programming | |||
Concatinate a function and make it work | Excel Discussion (Misc queries) | |||
HOW DO YOU MAKE FORECAST FUNCTION WORK IN EXCEL? | Excel Worksheet Functions | |||
Custom function does not work from an addin | Excel Programming |