Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put a tooltip on a user-defined function

Tags:

excel

vba

In Excel 2007, how do I add a description and parameter hints to a user-defined function? When I start typing a function invocation for a built-in function, Excel shows a description and parameter list--a tooltip. I'd like to do the same for the functions I define.

Not just for the formula insert wizard, but in the formula box, so if I key "=myFun(", at the "(" the tooltip pops up just like it does for "=average("

There's no help in VBA Help, none on MSDN and none on any of the Excel and VBA dedicated forums I can find, so this is clearly a long shot.

like image 942
Marc Thibault Avatar asked Nov 24 '10 00:11

Marc Thibault


People also ask

How do I use tooltip in VBA?

Place a hyperlink with a screen tip underneath the combobox, when you mouse over the combobox the screen tip will pop up. You can place the hyperlink on many cells if you intend on stretching the combobox over many cells.

How do you add user defined function in Excel?

I usually provide instructions to my users to type =myfunction("help") to get the syntax help and just put an if statement to return the intellisense.


1 Answers

Not a tooltip solution but an adequate workaround:

Start typing the UDF =MyUDF( then press CTRL + Shift + A and your function parameters will be displayed. So long as those parameters have meaningful names you at-least have a viable prompt

For example, this:

=MyUDF( + CTRL + Shift + A

Turns into this:

=MyUDF(sPath, sFileName)

like image 171
AutomationMan Avatar answered Sep 21 '22 17:09

AutomationMan