30.04.2017 Views

4523756273

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

346<br />

Part V: Putting It All Together<br />

appear in the Insert Function dialog box. Custom functions appear in the<br />

User Defined category.<br />

Function procedures defined with the Private keyword do not appear in the<br />

Insert Function dialog box. Therefore, if you write a Function procedure that’s<br />

designed to be used only by other VBA procedures (but not in formulas), you<br />

should declare the function as Private.<br />

Displaying the function’s description<br />

The Insert Function dialog box displays a description of each built-in function.<br />

But, as you can see in Figure 20-5, a custom function displays the following<br />

text as its description: No help available.<br />

Figure 20-5:<br />

By default,<br />

the Insert<br />

Function<br />

dialog box<br />

does not<br />

provide a<br />

description<br />

for custom<br />

functions.<br />

To display a meaningful description of your custom function in the Insert<br />

Function dialog box, perform a few additional (nonintuitive) steps:<br />

1. Activate a worksheet in the workbook that contains the custom<br />

function.<br />

2. Choose Developer➪Code➪Macros (or press Alt+F8).<br />

The Macro dialog box appears.<br />

3. In the Macro Name field, type the function’s name.<br />

Note that the function does not appear in the list of macros; you must<br />

type the name in.<br />

4. Click the Options button.<br />

The Macro Options dialog box appears.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!