Page 308 - Excel Workbook for Dummies
P. 308
32_798452 ch22.qxp 3/13/06 7:48 PM Page 291
Chapter 22: Using Macros 291
Remember that the & (ampersand) character is used in pull-down menu names
to define the hot key that the user can press along with the Alt key (Alt+M in this
case).
5. Select Assign Macro on the MOM Company Name menu item’s shortcut menu to
open the Assign Macro dialog box.
6. Click PERSONAL.XLS!Company_Name in the Macro Name list box and then select
OK.
7. Select Begin a Group on the MOM Company Name menu item’s shortcut menu.
Excel responds by drawing a horizontal separator above the MOM Company
Name menu item on the Insert pull-down menu. (You can also insert these kinds
of horizontal menu separators by dragging the menu item downward on its
menu.)
8. Add a second Custom Menu Item to the bottom of the Insert pull-down menu
immediately below the MOM Company Name item. Name this menu item
&Twelve Months and assign the PERSONAL.XLS!Twelve_Months macro to it.
9. Click the Toolbars tab in the Customize dialog box and then click the Links check
box (at the bottom of the list) in the Toolbars list box.
Excel responds by displaying the floating Links custom toolbar you created in
Exercise 21-4 in Chapter 21. This toolbar contains three buttons to which hyper-
links are assigned. You will now add a new section to the Links toolbar with
custom buttons to which you assign your Company_Name and Twelve_Months
macros.
10. Click the Commands tab and then drag the Custom Button from the Commands
list box and drop it to the immediate right of the very last button on the custom
toolbar with the link to the Dummies Web site.
11. Drag this new custom button slightly to the right until a vertical separator
appears between the two buttons with the happy face icons.
12. Right-click the new custom button and then replace &Custom Menu Item with
Company Name in the Name text box.
The name you assign here becomes the ToolTip for the button, identifying the
button’s function when you position the mouse pointer over it. Note that there’s
no need to include an & (ampersand) as part of custom button names as toolbar
buttons can only be clicked and therefore have no use for hot keys.
13. Select the pencil icon on the Change Button Image pop-up palette (the fourth one
from the left in the fourth row).
14. Select Assign Macro at the very bottom of the new custom button’s shortcut
menu and then select PERSONAL.XLS!Company_Name in the Macro Name list
box before you select OK.
15. Add a second custom button to the end of the Links custom toolbar (to the
immediate right of the button with the pencil icon) and then change this
button’s image to the calculator (the one second from the left in the third row
of the Change Button Image pop-up palette). Give it the name Twelve Months
and, finally, assign the PERSONAL.XLS!Twelve_Months macro to it.
16. Close the Customize dialog box and then test out your two custom menu items
on the Insert pull-down menus and two new buttons on the Links custom toolbar.
17. After testing the menu items and buttons, close the Links toolbar and then exit
Excel without saving your changes to the Book1 workbook.