Call 212-729-7216

The Visual Basic Applications Editor

The Visual Basic Applications Editor

Part 1 of 3

Watch The Video On Youtube:


The VB Editor (VBE) is a free program included with Microsoft Office applications like Word, Excel, and PowerPoint that allows you to create, debug, and store Visual Basic Applications (VBA) code. The Visual Studio suite offers a more robust VB Editor which Microsoft thoroughly documents at their MSDN website here.

The VB Editor has not changed dramatically in almost 15 years despite the new user interface beginning with Office 2007. The VB Editor still resembles the interface in Office ’97. The MSDN Office website provides minimal documentation about the VB Editor’s features, so this post is part one of a three part series that will expand on how to use the VB Editor when writing and debugging VBA programs.

Starting The VB Editor

There are many ways to start the VB Editor but the easiest is to hold the Alt key and tap the F11 key. Alt+F11 works in all Office programs.

Alt F11 Keys

VB Editor Components

The VB Editor window is comprised of menus, toolbars and window panes. The illustration below lists the names of each VB Editor window element.

VB Editor Window

Show/Hide Panels

The Project Explorer, Properties, and Immediate panels all take up space and reduce the amount of room you have to work with the code window. Close WindowIf you need more room to display your code you can close these panels by clicking the small x in the upper right corner of each panel.

To show a hidden panel, select the view menu, then the panel name. You can also use keyboard shortcuts to show/hide panels. There are also toolbar buttons to show windows.

 Immediate Window  Ctrl+G
 Project Explorer  Ctrl+R
 Properties Window  F4

view menu window commands

Size Windows

Although you can close the project explorer, immediate window, and properties window to allow more room to view your VBA code, typically you’ll want to keep the immediate and project explorer windows open (more on why in Part 2 and Part 3 of this series).

To change the width of the project explorer window and the properties window:

  1. Hover your move over the vertical grey bar along the right edge
  2. When the mouse cursor changes shape from a north-west arrow pointer or i-beam pointer to a window splitter cursor, click and hold the left mouse button and drag the mouse left or right to decrease/increase the width of the window panel.

Window Splitter

 

Show/Hide Toolbars

When you first start the VB Editor from any office program it is likely that you will only see one of the four available toolbars. I recommend that you show all four of the toolbars as they’ve got buttons that you will find useful as you write and debug your VBA programs.

There are several techniques available to show missing toolbars. Either:

  • Right click any menu or toolbar, then left click on a command like ‘edit’, ‘debug’, or ‘userform’
  • Select the View Menu > Toolbars > ‘Choose One’ command.

In Part 3 of this tutorial I will further explain why you should show these toolbars as we use their buttons/commands.

Dock and Undock Windows and Toolbars

The toolbars and the window panels are currently docked, meaning they appear in a fixed location at the edge of the VB Editor window. You can move the toolbars and panels so that they float over the VB Editor Window workspace but i do not encourage it. However, in the event you accidentally undock/float one of the toolbars or window panels, it is important that you know how to re-dock it.

To Float A Toolbar:

  • Point/hover your mouse cursor over the vertical line of dots along the left edge of a toolbar (the move handle)
  • When the cursor changes shape to a 4-headed cursor, click and hold the left mouse button, then drag the mouse up or down to undock it

To Dock A Toolbar:

  • Double click the blue/grey title bar (color depends on OS settings). The blue/grey title bar is the long horizontal band across the top edge of the toolbar that shows the toolbar’s name.

To Float A Window Panel:

  • Point your mouse over the grey horizontal band along the top edge (the title bar, its color may vary depending on your OS settings).
  • Using the North-West pointing arrow cursor shape, click and hold the left mouse button and drag away (up/down/left/right) from the docked position

To Dock A Window Panel:

  • Click and drag the horizontal title bar to an edge of the VB Editor workspace. When the dotted outline shape of the panel changes to approximate the width of the docking zone, release the mouse button.

In Summary

Although the Microsoft Office Suite has a new interface that sports the fluid ribbon, Microsoft has not publicly stated when, if ever, the vb editor will see a similar upgrade. I, for one, am not holding my breath, i’m sure Microsoft is busy addressing the thousands of other known bugs in their software that haven’t been fixed in over 15 years (don’t get me started, that’s for another blog post).

If any part of this tutorial was unclear and needs improvement, or you have questions or concerns, please do not hesitate to contact us.

In Part 2 of our 3 part series we will explore the importance of the VB Editor option settings. Stay tuned for the next installment in a few days.