Understanding the VBA Development Environment
The VBA environment is the one part of Excel that you will obviously need to get used to the most if you are to make the most of VBA’s capabilities. Luckily, Excel has made this environment very intuitive, allowing you to easily reach the areas that you need to work on at that moment. The way to open the VBA environment is to simply to click on the VBA button in the ribbon that you made previously. You will see a window pop open with everything you need in order to use VBA and all of its functions.
At first, it may look like it has too many buttons for you to grab a hold of, but you will soon realize that most of the buttons that you are seeing are actually buttons that you have used in your life before. If you have ever worked in Microsoft Office on a document that included text, you will have easily seen almost all of these buttons before and you will already know how to use them all.
The VBA environment is divided into the area on the left which is known as the project, and the area on the right which is where you will create and review all of the codes that you have made. Now, let’s make your first quick little code to get you started!
In the white area on the right, type this code:
Sub Helloeveryone()
MsgBox "Hello everyone!"
End Sub
You will see the code appear in the coding window, and you will also notice that some of the words are in a different color, as we mentioned before.
Now let’s see how it looks like when you actually run the code. To run the code, check out the toolbar above. You will see a green triangle which looks like a “play” button. Click on the green triangle and your code will pop out in front of you in a new little window, and it will say Hello everyone!