Excel VBA
Introduction To VBA: Macros And Automation Part 1
The VBA Editor
Navigating To The Editor
The VBA editor window is accessible through the Developer tab in Excel. By default, this tab is hidden from the ribbon. As a second to this, it is important to ensure that your version of Excel has the Analysis Toolpak – VBA activated.
The first step is to validate if the add-in is installed and activated. To do so with Excel 365 and other recent versions of the Office Suite we must follow these steps:
1. Go to the File menu
2. Open the Excel Options menu
3. Navigate to the Add-ins section
4. At the bottom of the window is a Manage drop-down menu, select Excel Add-ins and press the Go… button
5. Activate the checkbox next to the Analysis Toolpak – VBA line and press the OK button
The second step of activating the Developer tab in similar versions of Excel is to do as follows:
1. Go to the File menu
2. Open the Excel Options menu
3. Navigate to the Customize Ribbon section
4. Under the right navigation menu locate the Developer option
5. Activate the checkbox next to the Developer option to activate the tab
Now, unless you have customized the layout of your Excel ribbon, the Developer tab should be displayed to the right of the View tab.
Within this tab we have options to run and record Macros, manage the available Add-ins for the system, and controls to allow the creation and management of objects that contain code or will interact with the spreadsheet.
The functions which we will be using include the Visual Basic, Macros, and Record Macro options from the Code section, as well as the Insert option from the Controls section.
The last step to get into the VBA editor is to press the Visual Basic button on the Developer tab. A shortcut to opening this window at any point from within Excel is using ALT+F11. This will launch the VBA window, where we can begin to code our first macro!