Page 756 - Excel 2013 All-in-One For Dummies
P. 756
738 Creating Custom Excel Functions
2. Choose View➪Object Browser from the Visual Basic Editor menu bar
or press F2.
This action opens the Object Browser window, which obscures the Code window.
3. Click the drop-down list box that currently contains the value <All Libraries> and then select VBAProject from the drop-down list.
When you select VBAProject from this drop-down list, the Object Browser then displays your user-defined function as one of the objects in one of the Classes in the pane on the left.
4. Right-click the name of your user-defined function.
This action selects the function and displays it in the Members pane on
the right, while at the same time displaying the object’s shortcut menu.
5. Click Properties on the shortcut menu.
This action opens the Member Options dialog box for your user-defined function, where you can enter your description of this function, as shown in Figure 2-7.
6. Type the text that you want to appear in the Insert Function and Function Arguments dialog box for the user-defined function in the Description text box and then click OK.
Now, you can close the Object Browser and save your changes.
7. Click the Close Window button to close the Object Browser and then choose the File➪Save command.
Figure 2-7:
Adding a description for the Commission user- defined function.
Using a custom function in your spreadsheet
The great thing about custom functions is that they can be inserted into your worksheets with the Insert Function button on the Formula bar. Figures 2-8 through 2-10 illustrate how easy it is to enter the custom Commission function in a worksheet with this button.