Share: Facebook | Twitter | Whatsapp | Linkedin Visits: 1025
We have seen how to record a macro in the previous topic, we will see how to write simple Hello World VBA macro. Follow the below steps to do this to show the “Hello World!” message box to the user.


To do this write the following line in the module.
Sub sbHello()
And then press Enter. You should see the code as follows:
Sub sbHello() End Sub
Our requirement is to show a message as “Hello World!” to do this write following line in the procedure.
MsgBox "Hello World!"
Now your procedure should look like this:
Sub sbHello() MsgBox "Hello World!" End Sub
You should see Hello World! message box as shown below: