Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Public Functions As Worksheet Available Functions

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Public Functions As Worksheet Available Functions

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Public Functions As Worksheet Available Functions

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Public Functions As Worksheet Available Functions

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
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
efficiency: database functions vs. math functions vs. array formula nickname Excel Discussion (Misc queries) 2 July 14th 06 04:26 AM
How do I make my functions public to all workbooks? DMB Excel Discussion (Misc queries) 3 February 16th 06 02:20 PM
microsoft.public.excel.worksheet.functions Ian Edmont Excel Discussion (Misc queries) 3 December 14th 05 09:06 AM
microsoft.public.excel.worksheet.functions Ian Edmont Excel Worksheet Functions 3 December 14th 05 09:06 AM
Programatically retrieve a list of public functions. Alan Howells Excel Programming 4 October 21st 03 02:28 PM


All times are GMT +1. The time now is 10:59 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"