How to Add Descriptions for Excel VBA User-Defined Functions
Question details
The user wants to add descriptions and argument tooltips to Excel VBA User-Defined Functions so they appear clearly in the Function Wizard.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Creating custom VBA functions and wanting to provide clear guidance for users through function and argument descriptions.
- Observed behavior
- Excel does not automatically provide function tooltips or descriptions for User-Defined Functions (UDFs) by default, unlike its built-in formulas.
Ensure you have the Developer tab enabled in Excel and that your workbook is saved as a Macro-Enabled Workbook (.xlsm) to retain your VBA code.
Use Application.MacroOptions to Register Descriptions
Run a VBA subroutine using Application.MacroOptions to register your custom function, its general description, and individual argument descriptions to the Function Wizard.
While Excel doesn't natively show on-the-fly tooltips as you type UDFs, you can populate the Function Wizard with detailed descriptions for both the function itself and its arguments using the Application.MacroOptions method.
Press Alt + F11 to open the Visual Basic for Applications (VBA) editor in your Excel workbook.
Click Insert > Module from the top menu and write your custom User-Defined Function (e.g., Function MyFunc(MyValue As Variant, MyRange As Range)).
In the same module, create a new Subroutine (e.g., Sub RegisterFunction()). Inside it, type Application.MacroOptions. Use the 'Macro' parameter to specify your function name, 'Description' for the main description, 'Category' for the grouping, and an Array for 'ArgumentDescriptions'.
Place your text cursor inside your RegisterFunction subroutine and press F5, or click the Run button. This permanently registers the function descriptions for this workbook.
Return to your worksheet, type =MyFunc( and press Ctrl+Shift+A to insert the argument names, or press Shift+F3 to open the Function Wizard and view your newly added descriptions.

Write and Manage VBA Macros with WPS Spreadsheet
WPS Office provides robust, built-in support for VBA macros and User-Defined Functions, allowing you to automate tasks and create custom functions seamlessly.
- 1. Open WPS Spreadsheet: Launch WPS Office and open your macro-enabled spreadsheet.
- 2. Access the Developer Tab: Navigate to the Developer tab on the top ribbon and click 'VBA Editor'.
- 3. Write Your UDF: Insert a module, write your custom function, and execute Application.MacroOptions to add descriptions.
- 4. Apply in Your Sheet: Use your custom function in spreadsheet cells and access the Function Wizard to view your descriptions.

Frequently Asked Questions
Why aren't my VBA function tooltips showing up as I type?
Excel does not display on-the-fly Intellisense tooltips as you type for VBA User-Defined Functions. To see assistance, you must press Ctrl+Shift+A after typing the function name and opening parenthesis to insert argument placeholders, or use the Function Wizard (Shift+F3).
Do I need to run the Application.MacroOptions code every time I open the workbook?
No, you only need to run the Application.MacroOptions subroutine once. The descriptions and category assignments are permanently saved within the workbook configuration.
Can I categorize my custom function in a specific Function Wizard group?
Yes, by using the Category argument in Application.MacroOptions, you can assign your UDF to a built-in category by passing its corresponding index number, or supply a custom string to create a brand new category.




