visual basic editor

Visual Basic Editor Tutorial for Excel – How to use the VBE?

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...

The Excel Visual Basic Editor is also sometimes referred to as the VBA Project window. The Visual Basic Editor (VBE) is a simple developer environment available in Excel, Access, PowerPoint, Word and all other MS Office applications. It allows you to code simple Visual Basic for Applications macros. If you are new to VBA checkout my VBA Tutorial.

Today we will learn the basics as well as some tips and tricks on how to master the VBE (Visual Basic Editor).

Think you know it all? Scroll down to the Tips and Tricks!

How to open the Visual Basic Editor?

The Developer tab in the Excel ribbon is required to work with Excel VBA. Apart from enabling you to access your VBA Project, it also contains other useful features and shortcuts which we will dive into later e.g. Macro recording, Form Controls (buttons, checkboxes etc.).

Did you know… you can use the ALT+F11 keyboard shortcut to open the Visual Basic Editor (VBE) window?

Add the Developer tab to your Excel ribbon

To open the options window go to:
File->Options->Customize Ribbon
Next select the Developer tab to add it to the Excel ribbon as shown below:

Excel VBA Tutorial: Select the
Select the “Developer” tab to add it to the Excel ribbon

Click Ok. You should now see a new tab in your Excel ribbon called Developer as shown below:

Excel VBA Tutorial: The Developer tab in the Excel ribbon
The Developer tab in the Excel ribbon

Click the Visual Basic button on the Developer ribbon

Click the button as shown below:

Excel VBA Tutorial: Click the Visual Basic button
Click the Visual Basic button

This will open the Visual Basic editor as shown below:

Excel VBA Tutorial: The VBA editor window
The VBA editor window

The Visual Basic Editor (VBE)

The VBE Project Window

The VBE Project Windows allows you to manage your VBA Project objects such as VBA Modules, Classes and Forms.

Excel Visual Basic Editor Overview
Excel Visual Basic Editor Overview

The VBE Code Window

THe VBE Code Window allows you to edit your VBA code – by selecting a VBA Module, Classes or Form in the VBE Project Window (see above).

Excel VBE Code Window Overview
Excel VBE Code Window Overview

VBE Tips and Tricks

Now for some tips and tricks.

Tip 1: Open the VBE (Visual Basic Editor) with VBA

May sound weird but it is actually a pretty neat trick. The following VBA code snippet can be set as a Button event to open the VBA Project Window:

Below a quick gallery tutorial of How to setup a button to open the VBE from an Excel Worksheet:

Tip 2: Open VBE Window on selected Macro

If opening the VBE (Visual Basic Editor) Window on the click of a Button is no specific enough.. why not a Macro that allows you to open the Visual Basic Project Window to not only open but also open the VBE on a specific Macro of your choice! The VBA code snippet below does precisely that.

The VBA code snippet will open the VBE Window on the “Test” VBA Macro:

Summary

The VBE (Visual Basic Editor) is where all the magic happens. Got any useful VBE tips or tricks of your own? Share them in the comments below!

Related Posts

Leave a Reply