This article is part of the Visual Tour of Excel’s Coding Dojo series, exploring each of the Excel VBA editor’s menus, toolbars, and windows. Here, we’ll take a close look at each VBA editor toolbar in Excel.
“I learned at an early stage that the most important thing I could do for my players was to give them the tools necessary to beat their opponent.”
Bobby Knight
If you wish to skip to any of the other posts in the series, click on any of the topics listed below:
- How to Open the VBA Editor in Excel
- Exploring each VBA Editor Menu in Excel
- Getting Started with the Project Explorer
- Getting Started with the Properties Window
- Exploring the VBA Editor’s Code Window
- Exploring the VBA Editor’s Immediate Window
- Getting Started with the Locals Window
- Getting Started with the Watch Window
Meet your Mat! The VBA Editor
Most great martial artists first had to get intimate with their dojo. Likewise, to master Excel VBA, you’ll have to get comfy loitering in its coding dojo, the VBA Editor. Naturally, the first step is to open the VBA editor.
“The Dojo is the only place you can die and come back to life, so use it.”
kyoshi Larry Mabson (American karateka)
I, for one, know how daunting the Excel VBA editor can appear to beginners – just take a look at the overview below! However, looks can be deceiving; at least that’s true here. I say that because anyone familiar with programming IDEs will tell you that the VBA editor is one of the more user-friendly IDEs out there.
IDE stands for Integrated Development Environment. They are software that consolidates application development tools.
Most developers only use a few of the VBA Editor’s menus, toolbars, and windows. As a result, they miss out on several tools that would make their work less stressful and enhance their productivity.
But you are not most developers, are you? For one thing, you are here, so I take it you would like to max out your VBA programming potential. Brilliant! You are well on your way there.
Excel VBA Editor Toolbars
Each Excel VBA editor toolbar is a horizontal collection of clickable icons, located below the Menu bar by default. They provide easy, quick, and direct access to the editor’s most frequently used features.
Although four toolbars are available in the VBA editor, only the Standard toolbar is visible by default. The View menu enables the selection and display of hidden toolbars, as shown in the image below.
You can also use the Alt + V + T key combination to do the same thing much faster. In the picture, the checkmark next to a toolbar’s name indicates that the toolbar is presently displayed.
VBA Editor Toolbar – Debug
This VBA editor toolbar contains icons for commands related to reviewing code execution and identifying errors – i.e., debugging.
Command | Icon | Description |
---|---|---|
Design Mode | Switches on design mode and becomes the Exit Design Mode command. | |
Run Sub/UserForm | Runs the active (i.e., having the cursor) procedure or userform. In break mode, this command becomes the Continue command. Moreover, this command becomes the Run Macro command if neither a procedure nor a userform is active. You can also use the "F5" key to invoke this command. |
|
Break | Pauses program execution, while exiting runtime and entering break mode. It allows you to step through your code, line by line, and make certain kinds of changes. You can also use either the "Ctrl + Break" or "Alt + R + K" keyboard shortcuts to invoke this command. | |
Reset | Clears the Call stack and module-level variables. You can also use the "Alt + R + R" keyboard shortcut to invoke this command. | |
Toggle Breakpoint | Inserts or deletes a breakpoint at the current executable statement. You can also invoke this command using either the "F9" key or the "Alt + D + T" keyboard shortcut. | |
Step Into | Runs your code one line or statement at a time. In design mode, it starts code execution and immediately switches to break mode before the first statement runs. Outside design mode, this command switches to break mode (if it wasn't already there) and runs only the current code line. You can also invoke this command using either the "F8" key or the "Alt + D + I" keyboard shortcut. | |
Step Over | Executes the next code line in the current procedure, while in break mode, regardless of whether the current code line contains a Call statement to another procedure. If a Call statement exists in the current code line, invoking Step Into instead of Step Over executes the first statement in the called procedure. Using Step Over in this scenario runs the called procedure as a unit and shifts execution to the next code line in the current procedure. You can also invoke this command using either the "Shift + F8" or "Alt + D + O" keyboard shortcuts. | |
Step Out | Executes all the code lines of a called procedure while in break mode, from the current to the last execution point in the called procedure. It displays the statement following the procedure call, once all remaining code lines in the called procedure have run. You can also invoke this command using either the "Ctrl + Shift + F8" or "Alt + D + U" keyboard shortcuts. | |
Locals Window | Shows the Locals window if it is not currently visible. You can also use the "Alt + V + S" keyboard shortcut to do this. | |
Immediate Window | Shows the Immediate Window if it is not currently visible. You can also use either the "Ctrl + G" or "Alt + V + I" keyboard shortcuts to do this. | |
Watch Window | Shows the Watch window if it is not currently visible. You can also use the "Alt + V + H" keyboard shortcut to do this. | |
Quick Watch | Shows the Quick Watch dialog box where you can view the current value of watch expressions of your choice. You can also invoke this command using either the "Shift + F9" or "Alt + D + Q" keyboard shortcuts. | |
Call Stack | Shows the Call Stack dialog box when you are stepping through your code. So, it is only available when you are debugging your code. You can also use either the "Ctrl + L" or "Alt + V + K" keyboard shortcuts to do this. |
VBA Editor Toolbar – Edit
This VBA editor toolbar grants houses icons for commands related to making changes to your code or displaying useful information pertaining to the code you’re writing.
Command | Icon | Description |
---|---|---|
List Properties/Methods | Shows the Tooltip IntelliSense listing the methods and properties of the object that has the cursor. You can also use either "Ctrl + J" or "Ctrl +Space" keyboard shortcuts to do this. | |
List Constants | Shows the Tooltip Intellisense listing the built-in enumeration constants of the property or argument that has the cursor. You can also use the "Ctrl + Shift + J" keyboard shortcut to do this. | |
Quick Info | Shows the Tooltip Intellisense displaying the format/template for the method or property that has the cursor. You can also use the "Ctrl + I" keyboard shortcut to do this. | |
Parameter Info | Shows the Tooltip Intellisense listing the arguments for the method that has the cursor located after the method's open bracket. You can also use the "Ctrl + Shift + I" keyboard shortcut to do this. | |
Complete Word | Auto-completes words while you type, provided you have typed a sufficient number of words to allow the editor to predict the word being typed correctly. You can also use the "Ctrl + Space" keyboard shortcut to do this. | |
Indent | Shifts a code line, or a block of code lines, to the next tab stop. You can also use the "Tab" key to Indent. | |
Outdent | Shifts a code line, or a block of code lines, to the previous tab stop. You can also use the "Shift + Tab" keyboard shortcut to Outdent. | |
Toggle Breakpoint | Inserts or deletes a breakpoint at the current executable statement. You can also invoke this command using either the "F9" key or the "Alt + D + T" keyboard shortcut. | |
Comment Block | Converts each code line in a selected code block into a comment (i.e., a type of non-executable statement) by prepending a comment character (') to each code line. | |
Uncomment Block | Converts each comment line in a selected code block into a regular code line (i.e., an executable statement) by deleting its prepended comment character ('). | |
Toggle Bookmark | Switches a bookmark on or off for the presently selected code line in the Code window. | |
Next Bookmark | Shifts the focus to the succeeding bookmark in your collection of bookmarks (i.e., the bookmark stack). | |
Previous Bookmark | Shifts the focus to the preceding bookmark in your collection of bookmarks (i.e., the bookmark stack). | |
Clear All Bookmarks | Deletes all bookmarks and empties your collection of bookmarks (i.e., the bookmark stack). |
VBA Editor Toolbar – Standard
This VBA editor toolbar houses icons for commonly used commands from different VBA editor menus. Normally, the Standard toolbar is displayed in the toolbar area of the VBA editor by default, while the other toolbars are hidden.
Command | Icon | Description |
---|---|---|
Microsoft Excel | Toggles the view between the Microsoft Excel application window and the VBA editor. You can also use the "Alt + F11" keyboard shortcut to do this. | |
Insert Object | Displays a menu where you can add a new UserForm, standard module (a.k.a. module), class module, or procedure to your VBA project. | |
Save Book1 | Saves the active workbook (or project) and all its forms and modules. You can also use the "Ctrl + S" keyboard shortcut to do this. | |
Cut | Copies the selected text to the clipboard while deleting it from its current location. You can also use either "Ctrl + X" or "Shift + Delete" keyboard shortcuts to do this. | |
Copy | Clones the selected text to the clipboard while retaining it in its current location. You can also use either "Ctrl + C" or "Ctrl + Insert" keyboard shortcuts to do this. | |
Paste | Implants the clipboard's content into the location you selected. You can also use either "Ctrl + V" or "Shift + Ins" keyboard shortcuts to do this. | |
Find | Shows the Find dialog box and allows you to search for a specific text. You can also use the "Ctrl + F" keyboard shortcut to do this. | |
Undo | Restores the last action, however, Cut and Copy operations in the Code window can't be undone. Icon label changes to Can't Undo if no changes were made. You can also use either "Ctrl + Z" or "Alt + Backspace" keyboard shortcuts to do this. | |
Redo | Restores your last action, and you can use it to retrieve your previous 20 actions. The icon's label changes to Can't Redo if no changes were made. | |
Run Sub/UserForm | Runs the active (i.e., having the cursor) procedure or userform. In break mode, this command becomes the Continue command. Moreover, this command becomes the Run Macro command if neither a procedure nor a userform is active. You can also use the "F5" key to invoke this command. | |
Break | Pauses program execution, while exiting runtime and entering break mode. It allows you to step through your code, line by line, and make certain kinds of changes. You can also use either the "Ctrl + Break" or "Alt + R + K" keyboard shortcuts to invoke this command. | |
Reset | Clears the Call stack and module-level variables. You can also use the "Alt + R + R" keyboard shortcut to invoke this command. | |
Design Mode | Switches on design mode and becomes the Exit Design Mode command. | |
Project Explorer | Opens the Project Explorer if it is currently not visible. You can also use either the "Ctrl + R" or "Alt + V + P" keyboard shortcuts to do this. | |
Properties Window | Opens the Properties window if it is currently not visible. You can also use either the "F4" key or the "Alt + V + W" keyboard shortcut to do this. | |
Object Browser | Opens the Object Browser if it is currently not visible. You can also use either the "F2" or "Alt + V + O" keyboard shortcuts to do this. | |
Toolbox | Opens the Toolbox floating windows for the UserForm that you have selected prior. You can also use the "Alt + V + X" keyboard shortcut to do this. | |
Microsoft Visual Basic Help | Takes you to Microsoft Office Dev Center's Develop Solutions and Customize Excel page on your browser. There, you'll find helpful information on Excel application and Excel VBA programming. |
VBA Editor Toolbar – UserForm
This VBA editor toolbar contains commands related to UserForm visual design. It avails you several options for aligning, sizing, spacing, grouping, and ordering UserForm controls.
Command | Icon | Description |
---|---|---|
Bring to Front | Moves the object/control that you've presently selected on a UserForm ahead (i.e., visually in front) of all the other objects/controls on the UserForm. You can also do this with the "Ctrl + J" keyboard shortcut. | |
Send to Back | Moves the object/control that you've presently selected on a UserForm behind (i.e., visually at the back) of all the other objects/controls on the UserForm. You can also do this with the "Ctrl + K" keyboard shortcut. | |
Group | Organizes a selection of UserForm controls into a group that can then be formatted as a unit. You can also do this with the "Alt + O + G" keyboard shortcut. | |
Ungroup | Dissolves a previously formed group of UserForm controls. You can also do this with the "Alt + O + U" keyboard shortcut. | |
Align | Displays a submenu of commands for aligning multiple UserForm controls at once. The available options are Lefts, Centers, Rights, Tops, Middles, Bottoms, and To Grid. The format/alignment of the control you selected first is applied to all other controls in the selection. You can also access this submenu using the "Alt + O + A" keyboard shortcut. | |
Center in Form | Displays a submenu of commands for centring one or more selected UserForm controls on a UserForm's central axes. The available options are Horizontally and Vertically. You can also do this with the "Alt + O + C" keyboard shortcut. | |
Make Same Size | Displays a submenu of commands for sizing multiple UserForm controls at once. The available options are Width, Height, and Both. The format/size of the control you selected first is applied to all other controls in the selection. You can also do this with the "Alt + O + M" keyboard shortcut. | |
Zoom | Increases or decreases the display of all objects/controls on a UserForm. The display scale ranges from 10% to 200%. |
The Long and Short of It
So, there you have it! The four built-in Excel VBA editor toolbars – Standard, Edit, Debug, and UserForm. Each being a collection of icons for menu commands that perform actions relating to their name.
You can also check out the Office Dev Center page for more info on the VBA editor’s toolbars.
As I mentioned earlier, this article is part of the Visual Tour of Excel’s Coding Dojo series exploring each of the Excel VBA Editor’s menus, toolbars, and windows. To check out any of the other posts in the series, click on topic links below:
- How to Open the VBA Editor in Excel
- Exploring each VBA Editor Menu in Excel
- Getting Started with the Project Explorer
- Getting Started with the Properties Window
- Exploring the VBA Editor’s Code Window
- Exploring the VBA Editor’s Immediate Window
- Getting Started with the Locals Window
- Getting Started with the Watch Window