Is UDF the way to go? Is there a better way?

P

Prof Wonmug

I want to write a bunch of functions (in Excel 2007) that can be
called from any worksheet and behave (as much as possible) exactly
like built-in functions.

I want the functions to have these properties:

1. Can be called from any worksheet (=MyFun(B4,C2,10, ...)).

2. Will behave exactly like built-in functions, namely:

a. Will show up on the function pick list. When I type "=my", MyFun
will be one of the choices.

b. Will prompt for the arguments as soon as the "(" is entered.

3. Can call any other function without qualifiers. That is, MyFun can
call the LN function without having to prefix it with

x = 2 * Application.WorksheetFunction.ln(y)

I have created an Add-In module and added a few functions to it. They
work, but they do not behave like built-in functions.

I think this worked in Excel 2003.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top