“Startup India” VBA- Writing Your First Macro

“Startup India”  VBA- Writing Your First Macro

We have seen how to record a macro in the previous topic, we will see how to write simple “Startup India” VBA macro. Follow the below steps to do this to show the “Startup India” message box to the user.

 

Hello World VBA- Writing Your First Macro –

 

Step 1: Open the VBA Editor (press Alt+F11)

Step 2: Select ‘Module’ from the Insert Menu

Step 3: Start a new procedure called ‘sbIndia’

 

To do this write the following line in the module.

 

Sub sbIndia()

And then press Enter. You should see the code as follows:

Sub sbIndia()
End Sub

Step 4: This is called a sub procedure where you will write the code as per your requirement.

 

Our requirement is to show a message as “Startup India” to do this write following line in the procedure.

MsgBox "Startup India!"
Now your procedure should look like this:

Sub sbIndia()
MsgBox "Startup India!"

End Sub

Step 5: You are Done! Yes, now run your macro by pressing ‘F5’


 

 

Share this post

Post Comment

twenty − eleven =