When you select a function in the Insert Function dialog box, a brief description of the function appears (see Figure 10-7). You can specify a description for your custom function in two ways: Either use the Macro dialog box or write VBA code.
If you don't provide a description for your custom function,the Insert Function dialog box displays the following text: No help available.
DESCRIBING YOUR FUNCTION IN THE MACRO DIALOG BOX
Follow these steps to provide a description for a custom function:
1. Create your function in the VBE.
2. Activate Excel, making sure that the workbook that contains the function is the active workbook.
3. Choose Tools ^ Macro ^Macros (or press Alt+F8).
The Macro dialog box lists available procedures, but your functions will not be in the list.
4. Type the name of your function in the Macro Name box.
5. Click the Options button to display the Macro Options dialog box.
6. Enter the function description in the Description box (see Figure 10-8). The Shortcut Key field is irrelevant for functions.
7. Click OK and then click Cancel.
After you perform the preceding steps, the Insert Function dialog box displays the description that you entered in Step 6 when the function is selected.
For information on creating a custom help topic accessible from the Insert Function dialog box, refer to Chapter 24.
When you use the Insert Function dialog box to enter a function, the Function Arguments dialog box is displayed after you click OK. For built-in functions, the Function Arguments dialog box displays a description for each of the function's arguments. Unfortunately, you cannot provide such descriptions for custom function arguments.
Another way to provide a description for a custom function is to write VBA code. The following statement assigns a description for the function named Commission:
Application.MacroOptions _ Macro:= "Commission", _
Descriptions "Calculates sales commissions"
You need to execute this statement only one time (not each time the workbook is opened).
Was this article helpful?