Investigating VBA code
In this recipe, we will inspect a short VBA subroutine. Like all programming languages, VBA has a specific syntax, and the best way to understand the principles is to see what the coding looks like.
What we're going to see here will lay the foundation for the other recipes in this book, so pay close attention.
Getting ready
In order to investigate and edit VBA code in Excel, or any of the other Office applications, we first need to activate the Developer toolbar. Here are the steps:
- Open MS Excel and select Blank workbook from the opening screen.
- Open the
01_VBA_Code.xlsm
sample file. Click on [Enable Content] on the SECURITY WARNING ribbon. - If the Developer ribbon is not visible, activate the Backstage View by clicking on File, which will display the following screen:
- From the category list on the left, select the last option, Options. The Excel Options dialog box appears: