VBA stands for Visual Basic for Applications, an event-driven programming language which means that it will fulfill events that we want to achieve in our applications and by applications I mean Microsoft Office applications such as MS-Excel, MS-word, MS-Access and other office applications.

Like any other programming language C , C++ or Java standalone programs cannot be ran in VBA as it runs on Office Applications.

It helps us to build customized applications and solutions to enhance the capabilities of those applications. The advantage of this facility is that you NEED NOT have visual basic installed on our PC, however, installing Office will only help in achieving the purpose.

 

Why do we NEED VBA?

You must be wondering that why do we need an additional programming language VBA for such an advanced and featured applications like Excel, Word or other, which already has a lot of built-in features but there are some actions and calculations that are difficult through the built-in functions given which can be achieved very easily through VBA Programming.

 

For example :

Below are some applications and actions that can be performed very easily through VBA instead of using Built-in features and Functions already given in Office applications.

 

◘  In Excel it is very hard to calculate the loan repayment using excel’s functions but it easy to program a VBA for such calculation.

◘  In MS-Word consider the user who opens a document in Word, makes a few changes, saves the document, and then closes it. In the world of VBA  programming, Word exposes a Document object. By using VBA code, you can instruct the Document object to do things such as Open, Save, or Close.

◘  In PowerPoint you can perform a lot of operations like Adding a slide after current slide, Deleting a slide or loop through all slides.

◘  In Outlook you can send bulk mails just by tapping a single button or Delete multiple attachments at once.

So, VBA can be very useful for us if we want to automate or customize our applications and extend their features and do whatever we desire to do.

Now, if there is a language for such works that doesn’t mean we should use it for every small work sometimes it can be very time taking and problematic in case you need the work to do in a particular time frame. So, for short actions like copy paste 2 or 3 things we can do it through options in applications.

Note :  Throughout this whole tutorial we will be dealing only with the VBA in MS-Excel.  

                

Accessing the VBA Editor


There are generally two ways to access the VBA Editor in the MS-Excel or in any other Office Applications.

1.   Shortcut :  In Excel window, press “ALT + F11” . A VBA window opens as shown in the image below.



2.   Manually opening VBA Editor through Developer options :

STEP 1 : Right Click on any of the menu tabs you will get the options below.



STEP 2:  Choose the Customize Quick Access Toolbar on the Drop down menu and then a window will appear.

STEP 3: Now select the Customize Ribbon option on the left menu now just check in on the Developer as shown in the image Below.



STEP 4: Now you will see a Developer Tab on the right of the VIEW Tab so just click on it.



Now you’ll see the very first option as Visual Basic , Click on it and you will be directed to the VBA Editor.




                                                                                                                                



Post a Comment

Previous Post Next Post