Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've created quite a few VBA functions which are invoked through the macros
menu but would like to be able to build a function which can be invoked in the cell like a WorksheetFunction object. When I build the function and try to embed it into a cell with the '=FunctionName()' syntax I get an error. Is there a way to make my functions available? -- Steve King |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you put the function in a regular code module (not a sheet
module and not the ThisWorkbook module), you should be able to call them directly from worksheet cells. If the function resides in another workbook, you need to include the workbook name in the function call. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Steve King" wrote in message ... I've created quite a few VBA functions which are invoked through the macros menu but would like to be able to build a function which can be invoked in the cell like a WorksheetFunction object. When I build the function and try to embed it into a cell with the '=FunctionName()' syntax I get an error. Is there a way to make my functions available? -- Steve King |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Make sure you place them in a General module (the type you get from
Insert=Module) Make sure they are not private. Public Function FunctionName() FunctionName = rnd() End function -- Regards, Tom Ogilvy "Steve King" wrote in message ... I've created quite a few VBA functions which are invoked through the macros menu but would like to be able to build a function which can be invoked in the cell like a WorksheetFunction object. When I build the function and try to embed it into a cell with the '=FunctionName()' syntax I get an error. Is there a way to make my functions available? -- Steve King |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Chip!
I suspected it would be an easy answer but sometimes those are the most difficult to find in the documentation. I had a module for the add-in but obviously was not addressing it correctly. "Chip Pearson" wrote: If you put the function in a regular code module (not a sheet module and not the ThisWorkbook module), you should be able to call them directly from worksheet cells. If the function resides in another workbook, you need to include the workbook name in the function call. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Steve King" wrote in message ... I've created quite a few VBA functions which are invoked through the macros menu but would like to be able to build a function which can be invoked in the cell like a WorksheetFunction object. When I build the function and try to embed it into a cell with the '=FunctionName()' syntax I get an error. Is there a way to make my functions available? -- Steve King |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
efficiency: database functions vs. math functions vs. array formula | Excel Discussion (Misc queries) | |||
How do I make my functions public to all workbooks? | Excel Discussion (Misc queries) | |||
microsoft.public.excel.worksheet.functions | Excel Discussion (Misc queries) | |||
microsoft.public.excel.worksheet.functions | Excel Worksheet Functions | |||
Programatically retrieve a list of public functions. | Excel Programming |