Working with Toolbars and Menus Interactively

Whether we choose to place a command button for a macro on an existing Excel toolbar or on a custom toolbar of our own making, we may need to specify, using the Excel user interface, when the toolbar in question will be displayed. We can create a new toolbar and display or hide existing toolbars by selecting the Customize option from the Tools menu. The Toolbars tab for the Customize dialog box is shown in Figure 10-2.

Figure 10-2. The Toolbars tab of the Customize dialog

Figure 10-2. The Toolbars tab of the Customize dialog

To create a new toolbar, simply click the New button. Excel opens the New Toolbar dialog, which prompts us for a name for the toolbar. After we assign it a unique name, Excel will create the toolbar, list it in the Toolbars list box, and display the toolbar. We can then populate the toolbar with buttons.

To display or hide existing toolbars, we simply check or uncheck their boxes in the Toolbars list box.

We can also create a new submenu, which can then be added to an existing menu or toolbar. To do this, we select the Commands tab of the Customize dialog (see Figure 10-3), then select the New Menu option in the Categories list box. Click on the New Menu item in the Commands list box and drag it to the appropriate menu or toolbar. Finally, we right-click on the new menu and enter its caption in the context menu's Name field.

Figure 10-3. The Commands tab of the Customize dialog

0 0

Post a comment