ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is UDF the way to go? Is there a better way? (https://www.excelbanter.com/excel-programming/427540-udf-way-go-there-better-way.html)

Prof Wonmug

Is UDF the way to go? Is there a better way?
 
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.


All times are GMT +1. The time now is 04:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com