Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default How to make a custom function to work in another workbook

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default How to make a custom function to work in another workbook

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you make the INFO("directory") function work? TimR[_2_] Excel Worksheet Functions 1 November 13th 09 01:20 AM
HOW TO MAKE A LIST OF WORK SHEET IN WORK BOOK IN EXCEL 2007 goutam Excel Programming 1 February 1st 08 07:40 AM
Concatinate a function and make it work Don Excel Discussion (Misc queries) 5 December 12th 07 04:31 AM
HOW DO YOU MAKE FORECAST FUNCTION WORK IN EXCEL? Sharon T Excel Worksheet Functions 1 October 7th 05 03:31 PM
Custom function does not work from an addin agarwaldvk[_8_] Excel Programming 2 July 16th 04 08:08 AM


All times are GMT +1. The time now is 10:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"