What is Excel VBA?

The acronym VBA stands for Visual Basic for Applications. Excel VBA is an implementation of Microsoft’s event-driven programming language called Visual Basic 6 and is the language used in all Microsoft Office products including Excel, Word, Access, PowerPoint, and Outlook.

Getting Started with the Excel VBA

The Visual Basic for Applications Editor (VBA Editor) is a powerful tool and serves as the gateway to automating Excel. It is also the IDE (Integrated development environment) for Excel VBA and allows you to write code also known as macros and these macros can then be used to automate actions in Excel. Let’s start by enabling the Developer tab to access the VBA Editor.

Enable the Developer tab

Enable the Developer by right clicking anywhere in the Excel ribbon then clicking “Customize the Ribbon…”

Now check the Developer box then click OK to add the Developer tab as a Main tab in Excel.

The DEVELOPER tab should now be available and contains most of the buttons needed to create macros in Excel.

Macro Security

Macros can pose a potential security risk and are disabled by default in Microsoft Office. Please follow these steps to enable macros to run unimpeded:

Click “Macro Security” in the DEVELOPER tab:

The Trust Center dialog will appear, check the radio button “Enable all macros” and “Trust access to the VBA project”:

Opening the VBA Editor

The quickest way to access the VBA editor is to press and hold Alt then press F11 while in Excel. This will automatically launch the VBA Editor main window. Alternatively, you can click the first button in the DEVELOPER tab called “Visual Basic”.

You should now see the Visual Basic Editor main window:

Turn off annoying syntax popups

Click Tools > Options

Then un-check the Auto Syntax Check