How to Use and Run VBA Code in Word, Excel, Access and PowerPoint

What is VBA

VBA stands for Visual Basic for Applications is a programming language created by Microsoft that you can use to extend the default functionality of Microsoft Office Applications like Word, Excel, Access and Powerpoint etc. using VBA code, you can automate many of the tasks that you regularly and repetitively perform.

In simple words, VBA lets you write small programs, called “macros” that can perform repetitive or complex tasks automatically.

One of the key advantages of using VBA (Visual Basic for Applications) is it saves a lot of time. Instead of doing the tasks manually repetitively, which can be tedious and time-consuming, VBA allows you to automate the process.

How to Use the VBA Code:

  1. Open the Visual Basic for Applications (VBA) editor or IDE by
    Clicking on Developer tab then from the Code Group Click On Visual Basic.

Click Here if you want show developer tab on Ribbon

developer tab on ribbon

OR by Pressing Alt + F11 (Alt plus F11) shortcut Key from Keyboard.

VBA IDE will opens up as bellow.

VBA Editor
  1. In the VBA editor, from the menu click on Insert > then click on Module to create a new module.
Insert New Module in VBA IDE
  1. Paste or write the code into the module.
Writing Code in VBA Module
  1. Click On Save icon (or Click on Run Icon) and Close the VBA editor.
Save, RUN and Close VBA Editor
  1. Press Alt+F8 to display the list of VBA macros, then select your created macro, and click on Run Button.
Micro Dialog Box to Execute VBA Micros

And finally, your VBA Micro will be executed.

Message Box after VBA Micros Execution

I hope this tutorial will help you to know how to use VBA Code. if you have any queries, suggestion or feedback feel free to contact us.

Thank you.

Similar Posts