If I type =vlookup(
(or any other native Excel function) in the formula bar and then click the little Fx button to the left of the formula I get a Function Arguments prompt with all the available arguments. In that prompt, below the functional arguments, is a one or two sentence description of the function and of each argument as you move your cursor from each argument's input box.
When I type in the name of my UDF and click the Fx I get an input box for all of my arguments but that is it. Is there a way I can add those same helpful type of descriptions that native Excel functions have?
Steps to Add a Description to a UDFLook to the pane on the right of the window and you should now see your UDF: If you do not see the UDF in the right pane, click through the items in the left pane until it appears. In the window that opens, type the description that you want in the Description box and then hit OK.
To add a new function, position your insertion point after the End Function statement that terminates the last function in the Code window, and begin typing. You can create as many functions as you need in this manner, and they will always be available in the User Defined category in the Insert Function dialog box.
I suggest further investigating the Application.MacroOptions method. That method allows you to provide not only a description for the function, but also a description for each of the arguments. For example, if you have a function called "SampleFunction" that takes two arguments, you can run the following and it will set you up nicely for using the fx button with your function.:
Private Sub RegisterMyFunction()
Application.MacroOptions _
Macro:="SampleFunction", _
Description:="calculates a result based on provided inputs", _
Category:="My UDF Category", _
ArgumentDescriptions:=Array( _
"is the first argument. tell the user what it does", _
"is the second argument. tell the user what it does")
End Sub
Type =FormulaName(
into a cell and then press Ctrl+Shift+A
and it will fill in the reference name of the arguments
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With