Dealing with the Insert Function Dialog

Excel's Insert Function dialog box is a handy tool. When you are creating a worksheet formula, this tool lets you select a particular worksheet function from a list of functions (see Figure 10-8). These functions are grouped into various categories to make it easier to locate a particular function. The Insert Function dialog box also displays your custom worksheet functions, and the Function Arguments dialog box prompts you for a function's arguments.

Trsort I-unction fctfjrch fa j function;

Trsort I-unction fctfjrch fa j function;

Tyj* b <J«iri>ïon of vtfu wartt Jo do irtd rtvn etct. Go

Of setecta&ategofy:

User Defined

'connssm 1u\:iDfiS-)(tsT"Cani,ntfsion 'conmsscn luTeSDrcrjdsn'CantTéBcnS

'myiun hJctofp.jilsw'ittySijm___

n-ns-eViv-ili ftencu'EVov.ebS Boofc2!Voi*e)Cajit

'connssm 1u\:iDfiS-)(tsT"Cani,ntfsion 'conmsscn luTeSDrcrjdsn'CantTéBcnS

'myiun hJctofp.jilsw'ittySijm___

n-ns-eViv-ili ftencu'EVov.ebS Boofc2!Voi*e)Cajit qt"iovevovn?k(tKr)

Seepielp fer helper Ihs ftjiïcn ard s a'gLnîite, fri Jii ton

catce

Figure 10-8: Inserting a custom function into a formula.

Note Custom Function procedures defined with the Private keyword do not appear in the Insert Function dialog box. If you develop a function that's intended to be used only in your other VBA procedures, you should declare it by using the Private keyword. However, declaring the function as Private does not prevent it from being used in a worksheet formula. It just prevents the function from displaying in the Insert Function dialog box.

By default, custom functions are listed under the User Defined category, but you can have them appear under a different category if you like. You also can add some text to describe the function. (I highly recommend this step.)

In the Insert Function dialog box, notice that the workbook name is also displayed for functions that are defined in a workbook other than the active workbook.

Note The Insert Function dialog box enables you to search for a function by keyword. Unfortunately, this search feature cannot be used to locate custom functions created in VBA.

0 0

Post a comment