We are going to start with a very simple script and then get into coding some useful VBA code. To start with, we are simply going to create a macro that displays a message box when it runs. These sections will help you visualize the steps needed to code, create, and deploy your macros.
Press the ALT + F11 keys to open the VBA editor in case you closed this window after our last section.
Click on the Insert menu and select the Module option, as shown in the following screenshot. You need to create a module before you can begin writing any code. In other words, modules hold the VBA code.
You will get a new window and have an object explorer that looks similar to the following screenshot. You can change the name of Module1, but for this section, we are going to keep the default name.
Type the following code into the module:
Sub Hello_World() ' My first VBA sub procedure MsgBox ("Hello World") End Sub
Can you explain this code to me?
On line one, we...