Customizing the VBA Debug Toolbar

There are some very handy commands that VBA does not expose by default. Here's a step-by-step guide to customizing the Debug toolbar in VBA.

Customizing the VBA Debug Toolbar

One of the keys to being productive as a developer is customizing your environment to match your work habits.  As an example, I want to take you through the customizations that I make to the Debug toolbar in the VBA IDE.

Displaying the Debug toolbar

By default, the Debug toolbar is not shown.  I find it to be quite a handy tool, so I always turn it on.  There are two ways to show the Debug toolbar in the VBIDE: via the menu and via the right-click menu (aka, context menu).

Showing the Debug toolbar via the Menu

Click on View > Toolbars > Debug (shortcut key: Alt + V, T, Enter)

Showing the Debug toolbar via the Context Menu

  1. Right-click on any empty area of the toolbar
  2. Click on the Debug option to toggle it on

Customizing the Debug Toolbar

While I find the Debug Toolbar useful, there are a few changes I always make that I find make it even handier.  First, here is the stock (i.e., unmodified) Debug toolbar:

The stock Debug toolbar (prior to customizing)

I make the changes below.  I find this updated version works really well for Microsoft Access development.

Buttons I remove from the Debug toolbar

To remove buttons from any toolbar, open the Customize dialog (Alt + V, T, C).  Then right-click on the button you want to remove and choose "Delete."  

You can also left-click and drag the icon off of the toolbar.  When you do this, a small "x" will appear to the bottom-right of the mouse pointer to indicate the button will be removed when you release the mouse button.

  • Remove the "Design Mode" button; I never use that in Access, but it may be more useful with other Office products
  • Remove the "Toggle Breakpoint" button; left-clicking in the margin to the left of  the line of code (or using the F9 shortcut key) are both much handier
  • Remove the "Immediate Window" button; Ctrl + G is seared into my memory (especially with this Autohotkey script which makes Ctrl + G a toggle to jump back and forth between code and the immediate window)

Buttons I add to the Debug toolbar

To add buttons to the toolbar, open the Customize dialog (Alt + V, T, C).

I add the following commands:

  • Debug > Compile Project
  • View > Last Position (right-click > Change Button Image > {left-pointing blue arrow}; right-click > Default Style)
  • View > Definition (right-click > Change Button Image > {down-pointing triangle}; right-click > Default Style)
  • Debug > Show Next Statement

Customized Debug Toolbar

Here's what the updated toolbar looks like:

My modified Debug toolbar, along with the keyboard-friendly shortcut keys/menu shortcuts.

What are your favorite VBA customizations?  Let me know in the comments below.

All original code samples by Mike Wolfe are licensed under CC BY 4.0