You are on page 1of 10

Presented by:

Dhirendra Meher
dhirendrameher12@Hotmail.com
VBA is the programming language used
within Excel to develop macros. It stands
for Visual Basic for Applications.
VBA stands for Visual Basic for Applications an event driven programming
language from Microsoft that is now predominantly used with Microsoft office
applications such as MS-Excel, MS-Word and MS-Access.

It helps techies to build customized applications and solutions to enhance the


capabilities of those applications. The advantage of this facility is that we
NEED NOT have visual basic installed on our PC but installing office will
implicitly help us to achieve the purpose.

We can use VBA in all office versions right from MS-Office 97 to MS-Office
2016 and also with any of the latest versions available. Among VBA, Excel
VBA is the most popular one and the reason for using VBA is that we can
build very powerful tools in MS Excel using linear programming.

You might wonder why we need to use VBA in excel as MS-Excel itself
provides loads on inbuilt functions. MS-Excel provides only basic inbuilt
functions which may not be sufficient to perform complex calculations. Under
those circumstances VBA becomes the most obvious solution.
Modules: Where we write Code (Right click -
Project Explorer window-Module

Procedure: These are nothing but the codes/lines

Sub Procedures: The whole lines which Executes


something

Function: In built Functions & UDF (User Defined


Functions)
A Variable is used to store temporary information that is
used for execution within the Procedure, Module or
Workbook. Before we go into some detail of Variables,
there are a few important rules that you must know about.

1. It should start from a Text


2. It should not more than 250 Characters
3. Can not be same matching Excel/VBA Keywords
4. Should be a continuous Text
Data Type Limit/Range of Values

Boolean True / False

Integer (%) -32768 to 32767

Long(&) -2,147,483,648 to 2,147,483,647

-922,337,203,685,477.5808 to
Currency(@)
922,337,203,685,477.5807
-3.402823E38 to -1.401298E-45 for neg values, and 1.401298E-
Single(!) 45 to 3.402823E38 for pos

-1.79769313486232E308 to -4.94065645841247E-324 for neg, 4.94065645841247E-324 to


Double(#) 1.79769313486232E308 for pos

Date January 1, 100 to December 31, 9999


Data Type Limit/Range of Values

String ($) 1 to 65,400 characters

Object Any Embeded object

Variant Anything large

Byte 0 to 255
Application
Workbook
Worksheet
Range
Cell
Let us take a Real Life Scenario

Objects:
Several Small Objects like Room, Door, Wall, Fan, etc…

Properties:
Different Measurements or Properties like Width, Height, Wall Colors, Names
etc.…

Collections:
You can say all of the rooms as Rooms Collection, all the doors can be Doors
Collection, etc.…

Events:
On Close the door, On Open the Door, On Switch on the TV, etc…

Methods:
There will be different actions like Cleaning, Painting, Washing, Watching, etc.…

You might also like