Results 1 to 2 of 2
2008-06-30, 08:01 #1
- Join Date
- Jul 2001
- Terneuzen, Netherlands
- Thanked 0 Times in 0 Posts
Using a Workbook name to trigger UDF behavior (Ex2003)
I'm developing a UDF. As I this is an enhancement to a standard Excel function, I'd like to use the Excel function's standard arguments. However my UDF could use additional 'switches' to control its behavior.
What I'm thinking is that my UDF could read a variable that a use sets. Could be a named-range (cell) with the switch value. Could also be a global name with that value. I'd like to know how to best implement this... I guess priority would be (1) cell-name on active sheet (2) local name (3) cell-name on another sheet (4) global name (not sure if I'm making myself clear enough).
What (quick) could could I add to my UDF to read that, or should I create a separate UDF to read and set these values maybe?
UPDATE: I just thought of something that might circumvent the problem (feedback would still be apprciated on the original question): what if I just implemented a menu-structure and control the settings from there?? Requires an Auto_open to set it up (and an Auto_close to remove it), then my UDF could just read the status of some entries which I can control...
2008-06-30, 08:04 #2
- Join Date
- Mar 2002
- Thanked 28 Times in 28 Posts
Re: Using a Workbook name to trigger UDF behavior (Ex2003)
Without knowing what you're actually trying to do it's hard to give specific advice, but if you add an optional argument of type Variant to the function, the user can omit the argument or supply a literal value, a cell reference or a defined name.