1
Macros
Training for EY
2
DISCLAIMER
The training content and delivery of this presentation is confidential, and cannot be
recorded, or copied and distributed to any third party, without the written consent
of Imarticus Learning Pvt. Ltd.
3
DISPLAYING THE FUNCTION’S DESCRIPTION
The Insert Function dialog box displays a description of each built-in function. But, a
custom function displays the following text as its description: No help available. To display
a meaningful description of your custom function in the Insert Function dialog box, perform
a few additional (nonintuitive) steps:
1. Activate a worksheet in the workbook that contains the custom
function.
2. Choose Developer➪Code➪Macros (or press Alt+F8).
The Macro dialog box appears.
3. In the Macro Name field, type the function’s name.
Note that the function does not appear in the list of macros; you
must type the name.
Private and Confidential 3
4
DISPLAYING THE FUNCTION’S DESCRIPTION
Private and Confidential 4
5
DISPLAYING THE FUNCTION’S DESCRIPTION
4. Click the Options button.
The Macro Options dialog box appears.
5. In the Description field, type a description of the function.
6. Click OK.
7. Click Cancel
Private and Confidential 5
6
DISPLAYING THE FUNCTION’S DESCRIPTION
Private and Confidential 6
7
TIP
Custom functions, by default, are listed in the User Defined category. To add
a function to a different category, you need to use VBA. This statement, when
executed, adds the TopAvg function to the Math & Trig category (which is
category #3):
[Link] Macro:=”TopAvg”, Category:=3
Check the Help system for other category numbers. And remember, you need
to execute this statement only one time. After you execute it (and save the
workbook), the category number is permanently assigned to the function
Private and Confidential 7
8
ARGUMENT DESCRIPTIONS
When you access a built-in function from the Insert Function dialog box, the
Function Arguments dialog box displays a description of each argument. In the past, it was
not possible to add argument descriptions. But, beginning with Excel 2010, Microsoft
finally implemented this feature. You provide argument descriptions by using the
MacroOptions method.
Here’s an example that adds descriptions for the arguments used by the TopAvg function:
Private and Confidential 8
9
ARGUMENT DESCRIPTIONS
Private and Confidential 9
1
0
ARGUMENT DESCRIPTIONS
You need to execute this procedure only one time.
After you execute it, the argument descriptions are
stored in the workbook and are associated with the
function.
Notice that the argument descriptions appear as
arguments for the Array function. You must use the
Array function even if you’re assigning a description
for a function that has only one argument.
Private and Confidential 10
1
1
1
2
FEEDBACK
Private and Confidential 12
1
3
We’re committed to empower you to be
#FutureReady
through powerful training solutions.
We build the workforce of the future.
250+ 30,000+ 25000+
Corporate Clients Learners Trained Learners Placed
FREE WEBINARS
Sign up for free webinars with industry
experts every fortnight! Enroll Now!
Contact us today!
[Link]