Tuesday 19 February 2013

VBA Basics - 1


MYTH!!!

VBA is a very critical software language, which, nobody except intellectual software professionals can understand and work on.

Simply… VBA in Excel does the same things which we do in the excel worksheets … and a few more extra.

You select a cell, format it with different colors, borders, styles, do CUT COPY and PASTE, insert a chart or pivot table in the sheet. Everything we do manually like these can be done automatically by telling Excel in its very simple language called VBA.

So the disclaimer is you don’t have to be panic, while just looking at a 10 page VBA code having colorful text. J It’s quite simple…believe me!

Let’s go through few sessions, to see some basics of VBA.

Visual Basic for Applications

VBA is Visual Basic for Applications.

If you are familiar with Excel before, you may know that, Macro is something we do for repetitive actions. We can record our steps and then use the macro next time to do the same things we did while recording. Don’t worry if you don’t know about this…look at VBA Recording (link)

When you record some actions, Excel remembers those actions, step by step and saves it somewhere. You can view them by typing Alt+F11. It opens Visual Basic Editor.

Excel Visual Basic Editor is the place where we tell Excel (instructions) to do something.

The Window looks something like this.