Menus In Excel97 And 2000
When Excel97 was released, the entire internal structure of Command Bars (toolbars and menus) was completely changed. The Menu Editor tool that existed in previous version of Excel was removed. Although menu items created in earlier versions of Excel will still work in Excel97 and 2000, the procedure for creating menus has changed. This page describes the procedures, both manually and with VBA code, for creating your own menu items. The procedures described here are quite simple. You should refer to the on line help or to the Office VBA Programmers Guide for more detailed information. These procedures will not work for creating menu items on tool bars in the Visual Basic Editor. For information about working with menus in the VBE, click here. Because the VBA procedures here use the CommandBar and CommandBarControl object types, you must set a reference in your VBA Project to the Microsoft Office 8 (or 9) Object Library. You can create new menu items by simply dropping and dragging command icons on to the menu bars or tool bars where you want them to appear, and then assign code to them.
|
|||
First, you will need to open the Customize dialog box, which puts Excel into the Command Bar Edit mode. To open this dialog, select Tool Bars from the View menu, and choose Customize from the list. Or, you can right-click on any empty part of a tool bar, and choose Customize from the pop up menu. The Customize dialog box is show on the right. |
|
||
From this dialog, choose the Commands tab, and scroll down to the Macros item in the Categories list. Now, choose the Custom Menu Item in the Commands list, and drag this to any menu you list. Position it in the menu list where you'd like it to appear. Now you've created a new menu item. The next step is to assign a macro to your new menu item. To do this, leave the Customize dialog open, and right click on the new menu item you created. The commands for customizing your new menu item are on the right click pop up menu, shown below:
|
|