0% found this document useful (0 votes)
36 views

Introduction To Visual Editor

Visual Basic is a programming language and IDE created by Microsoft in 1991 for COM programming. It was intended to be easy to learn and use. The Visual Basic Editor allows writing procedures called Sub procedures or Function procedures using commands to perform specific tasks. Ranges and cells can be selected in Visual Basic using the Range and Cells objects along with cell references in double quotes. Worksheets can be selected before accessing cells on another sheet. Variables can be declared with the Dim keyword and assigned values to store in memory, with integer or string variable types.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Introduction To Visual Editor

Visual Basic is a programming language and IDE created by Microsoft in 1991 for COM programming. It was intended to be easy to learn and use. The Visual Basic Editor allows writing procedures called Sub procedures or Function procedures using commands to perform specific tasks. Ranges and cells can be selected in Visual Basic using the Range and Cells objects along with cell references in double quotes. Worksheets can be selected before accessing cells on another sheet. Variables can be declared with the Dim keyword and assigned values to store in memory, with integer or string variable types.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

INTRODUCTION TO VISUAL BASIC

EDITOR
VISUAL BASIC
 is a third generation event – driven programming language and integrated
development environment (IDE) from Microsoft for its Component Object
Model(COM) programming model first released in 1991 and declared legacy
during 2008.
 Microsoft intended Visual Basic to be relatively easy to learn and use.
Introduction to Visual Basic Editor
Sub
 a set of commands to perform a
specific task is placed into a
procedure, which can be a Function
procedure or a Sub procedure (also
known as functions and
subroutines)
Range/Cells
Range (“A1”) tells VBA the
address of the cell that we want
to refer to.
Select is a method of the
range object and select
cells/range specified in the
range object. The cell
references need to be
enclosed in double quotes.
Range/Cells

• Instead of Range, you can also use cells.


• Using cells is particularly useful when you
want to loop through ranges.
Selecting Worksheet
• To select the cell in another sheet (let’s say
Sheet2), you need to first activate Sheet2
and then select the cell in it.
Selecting a Fix Sized Range
• Code that will select the range A1:D20
• The above code takes the top – left
cell address (A1) and the bottom –
right cell address (D20) and selects
the entire range
Copying Single Cell
• To copy cell A1 and paste it into cell D1.
Excel VBA and Variables
Variable
Use to store in memory
2 Types of Variables
1. Integer
2. String
Dim
keyword goes at the start
tells the programme to set up a
variable of this name and type
Excel VBA and Variables

MyNumber
variable name
As Integer
type of variable
as a whole number
MyNumber = 10
assigning values of 10
Variable Practice:
Making Decisions:

You might also like