SlideShare a Scribd company logo
1 of 21
Intro to VBA
Programming
Ivey Technology Club
Intro to VBA Programming

Agenda
 Variables




Types
Declaration
Assignment

 Functions/Subroutines



Parameters
Returning values

 Loops



While
For
Intro to VBA Programming

Agenda
 Variables




Types
Declaration
Assignment

 Functions/Subroutines



Parameters
Returning values

 Loops



While
For
Intro to VBA Programming

 You‟ve

seen variables before

X

=5
Y=X+3
 Variables

can be reused and changed

X

=5
X=2
X=X+7
 The

same principles apply in
programming
Variables

Functions

Loops
Intro to VBA Programming

 Computers

are stupid

 Must

tell them exactly what to do
 The more we tell them, the faster they run
 Each

language does this differently

 We

will focus on VBA

Variables

Functions

Loops
Intro to VBA Programming

 All

variables should be declared first

 This

will prevent hard to find errors

 It

is not required that you do so, but HIGHLY
encouraged

 To

force yourself, use “Option Explicit” at the
beginning of VBA files

Variables

Functions

Loops
Intro to VBA Programming

 To

declare a variable in VBA, the basic
structure is:
Dim <name> as <type>
Ex. Dim X as Integer

Variables

Functions

Loops
Intro to VBA Programming

 Dim

means “new Dimension”

 Fancy

VBA way of saying new variable

 When

declaring a variable, you should
know what it will be used for

 Different

variable types are used to store
different data

Variables

Functions

Loops
Intro to VBA Programming

 Types

include:

 Integer

(whole numbers like 3)
 Float (decimal numbers like 1.25)
 Double (just like float, can store wider range
of values)
 Characters (like „a‟)
 String (a number of characters in a row such
as “Ivey”)
 MANY

Variables

more

Functions

Loops
Intro to VBA Programming

 Types

include:

 Integer

(whole numbers like 3)
 Float (decimal numbers like 1.25)
 Double (just like float, can store wider range
of values)
 Characters (like „a‟)
 String (a number of characters in a row such
as “Ivey”)
 MANY

Variables

more

Functions

Loops
Intro to VBA Programming

 To

assign a value to a use the “=“
operator
 Ex.

Dim x As Integer (declare the variable)
x=5

Variables

Functions

Loops
Intro to VBA Programming

Agenda
 Variables




Types
Declaration
Assignment

 Functions/Subroutines



Parameters
Returning values

 Loops



While
For
Intro to VBA Programming

Functions
 Take

in input, process it, and produce
output

Variables

Functions

Loops
Intro to VBA Programming

 Functions
 General

must also be declared

format of function declaration:

Function <name>(ByVal <parameterName> As <type>) As <returnType>

 Subroutines

are declared the same way,
but do not have a return type

Variables

Functions

Loops
Intro to VBA Programming

 ByVal

refers to “by value”

 This

will make a copy of the variable and its
value

 ByRef

could also be used

 This

 Don‟t

will modify the original variable

worry too much about this for now

Variables

Functions

Loops
Intro to VBA Programming

 To

explicitly return a value from a
function, assign the return value to the
function name itself

Variables

Functions

Loops
Intro to VBA Programming

 Subroutines

are the same as functions,
except for 2 important differences:
1.

They do not have explicit return types

2.

They cannot be used directly in the
spreadsheet

Variables

Functions

Loops
Intro to VBA Programming

Agenda
 Variables




Types
Declaration
Assignment

 Functions/Subroutines



Parameters
Returning values

 Loops



While
For
Intro to VBA Programming

Loops
 Loops

allow us to repeatedly perform the
same task easily

 There

are different kinds of loops
including:
 While
 Until
 For

Variables

Functions

Loops
Intro to VBA Programming

 “While”

true

 “Until”

true

loops while a certain condition is

loops until a certain condition is

 “For”

loops for a specified number of
iterations

Variables

Functions

Loops
Intro to VBA Programming

Questions, anyone ?

More Related Content

What's hot

E learning excel vba programming lesson 3
E learning excel vba programming  lesson 3E learning excel vba programming  lesson 3
E learning excel vba programming lesson 3Vijay Perepa
 
E learning excel vba programming lesson 2
E learning excel vba programming  lesson 2E learning excel vba programming  lesson 2
E learning excel vba programming lesson 2Vijay Perepa
 
Excel VBA programming basics
Excel VBA programming basicsExcel VBA programming basics
Excel VBA programming basicsHang Dong
 
E learning excel vba programming lesson 1
E learning excel vba programming  lesson 1E learning excel vba programming  lesson 1
E learning excel vba programming lesson 1Vijay Perepa
 
Transforming Power Point Show with VBA
Transforming Power Point Show with VBATransforming Power Point Show with VBA
Transforming Power Point Show with VBADCPS
 
Advance MS Excel
Advance MS ExcelAdvance MS Excel
Advance MS Excelacute23
 
AVB201.2 Microsoft Access VBA Module 2
AVB201.2 Microsoft Access VBA Module 2AVB201.2 Microsoft Access VBA Module 2
AVB201.2 Microsoft Access VBA Module 2Dan D'Urso
 
Creating A User‑Defined Function In Excel Using Vba
Creating A User‑Defined Function In Excel Using VbaCreating A User‑Defined Function In Excel Using Vba
Creating A User‑Defined Function In Excel Using VbaChester Tugwell
 
Visual Basics for Application
Visual Basics for Application Visual Basics for Application
Visual Basics for Application Raghu nath
 
AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1guest38bf
 
Access tips access and sql part 2 putting vba and sql together
Access tips  access and sql part 2  putting vba and sql togetherAccess tips  access and sql part 2  putting vba and sql together
Access tips access and sql part 2 putting vba and sql togetherquest2900
 

What's hot (20)

E learning excel vba programming lesson 3
E learning excel vba programming  lesson 3E learning excel vba programming  lesson 3
E learning excel vba programming lesson 3
 
Vba Class Level 1
Vba Class Level 1Vba Class Level 1
Vba Class Level 1
 
E learning excel vba programming lesson 2
E learning excel vba programming  lesson 2E learning excel vba programming  lesson 2
E learning excel vba programming lesson 2
 
Vba introduction
Vba introductionVba introduction
Vba introduction
 
Excel VBA programming basics
Excel VBA programming basicsExcel VBA programming basics
Excel VBA programming basics
 
E learning excel vba programming lesson 1
E learning excel vba programming  lesson 1E learning excel vba programming  lesson 1
E learning excel vba programming lesson 1
 
Vba
Vba Vba
Vba
 
Excel vba
Excel vbaExcel vba
Excel vba
 
VBA
VBAVBA
VBA
 
Transforming Power Point Show with VBA
Transforming Power Point Show with VBATransforming Power Point Show with VBA
Transforming Power Point Show with VBA
 
Vba Class Level 3
Vba Class Level 3Vba Class Level 3
Vba Class Level 3
 
Advance MS Excel
Advance MS ExcelAdvance MS Excel
Advance MS Excel
 
AVB201.2 Microsoft Access VBA Module 2
AVB201.2 Microsoft Access VBA Module 2AVB201.2 Microsoft Access VBA Module 2
AVB201.2 Microsoft Access VBA Module 2
 
Creating A User‑Defined Function In Excel Using Vba
Creating A User‑Defined Function In Excel Using VbaCreating A User‑Defined Function In Excel Using Vba
Creating A User‑Defined Function In Excel Using Vba
 
Visual Basics for Application
Visual Basics for Application Visual Basics for Application
Visual Basics for Application
 
AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1AVB201.1 MS Access VBA Module 1
AVB201.1 MS Access VBA Module 1
 
07 java variables
07   java variables07   java variables
07 java variables
 
Access tips access and sql part 2 putting vba and sql together
Access tips  access and sql part 2  putting vba and sql togetherAccess tips  access and sql part 2  putting vba and sql together
Access tips access and sql part 2 putting vba and sql together
 
Fieldsymbols
FieldsymbolsFieldsymbols
Fieldsymbols
 
Operators in java By cheena
Operators in java By cheenaOperators in java By cheena
Operators in java By cheena
 

Similar to Intro to Excel VBA Programming

200 Mega eBook Collection- http://bit.ly/3WEZuYJ
200 Mega eBook Collection- http://bit.ly/3WEZuYJ200 Mega eBook Collection- http://bit.ly/3WEZuYJ
200 Mega eBook Collection- http://bit.ly/3WEZuYJDannySingh23
 
Financial modeling sameh aljabli lecture 6
Financial modeling   sameh aljabli   lecture 6Financial modeling   sameh aljabli   lecture 6
Financial modeling sameh aljabli lecture 6Sameh Algabli
 
Unit 3-Javascript.pptx
Unit 3-Javascript.pptxUnit 3-Javascript.pptx
Unit 3-Javascript.pptxAmanJha533833
 
Handout # 4 functions + scopes
Handout # 4   functions + scopes Handout # 4   functions + scopes
Handout # 4 functions + scopes NUST Stuff
 
Notes5
Notes5Notes5
Notes5hccit
 
Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]srikanthbkm
 
Arrays &amp; functions in php
Arrays &amp; functions in phpArrays &amp; functions in php
Arrays &amp; functions in phpAshish Chamoli
 
04. WORKING WITH FUNCTIONS-2 (1).pptx
04. WORKING WITH FUNCTIONS-2 (1).pptx04. WORKING WITH FUNCTIONS-2 (1).pptx
04. WORKING WITH FUNCTIONS-2 (1).pptxManas40552
 
Functions in c++, presentation, short and sweet presentation, and details of ...
Functions in c++, presentation, short and sweet presentation, and details of ...Functions in c++, presentation, short and sweet presentation, and details of ...
Functions in c++, presentation, short and sweet presentation, and details of ...Sar
 
Functional JavaScript Fundamentals
Functional JavaScript FundamentalsFunctional JavaScript Fundamentals
Functional JavaScript FundamentalsSrdjan Strbanovic
 

Similar to Intro to Excel VBA Programming (20)

200 Mega eBook Collection- http://bit.ly/3WEZuYJ
200 Mega eBook Collection- http://bit.ly/3WEZuYJ200 Mega eBook Collection- http://bit.ly/3WEZuYJ
200 Mega eBook Collection- http://bit.ly/3WEZuYJ
 
Intro to Scala
 Intro to Scala Intro to Scala
Intro to Scala
 
Financial modeling sameh aljabli lecture 6
Financial modeling   sameh aljabli   lecture 6Financial modeling   sameh aljabli   lecture 6
Financial modeling sameh aljabli lecture 6
 
Unit 3-Javascript.pptx
Unit 3-Javascript.pptxUnit 3-Javascript.pptx
Unit 3-Javascript.pptx
 
functions new.pptx
functions new.pptxfunctions new.pptx
functions new.pptx
 
Handout # 4 functions + scopes
Handout # 4   functions + scopes Handout # 4   functions + scopes
Handout # 4 functions + scopes
 
Notes5
Notes5Notes5
Notes5
 
C functions
C functionsC functions
C functions
 
Improved VBA support
Improved VBA supportImproved VBA support
Improved VBA support
 
Unit 2.5
Unit 2.5Unit 2.5
Unit 2.5
 
MA3696 Lecture 9
MA3696 Lecture 9MA3696 Lecture 9
MA3696 Lecture 9
 
Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]
 
Javascript functions
Javascript functionsJavascript functions
Javascript functions
 
Arrays &amp; functions in php
Arrays &amp; functions in phpArrays &amp; functions in php
Arrays &amp; functions in php
 
Qtp vb scripting
Qtp vb scriptingQtp vb scripting
Qtp vb scripting
 
Unit 2.5
Unit 2.5Unit 2.5
Unit 2.5
 
04. WORKING WITH FUNCTIONS-2 (1).pptx
04. WORKING WITH FUNCTIONS-2 (1).pptx04. WORKING WITH FUNCTIONS-2 (1).pptx
04. WORKING WITH FUNCTIONS-2 (1).pptx
 
Functions in c++, presentation, short and sweet presentation, and details of ...
Functions in c++, presentation, short and sweet presentation, and details of ...Functions in c++, presentation, short and sweet presentation, and details of ...
Functions in c++, presentation, short and sweet presentation, and details of ...
 
Functional JavaScript Fundamentals
Functional JavaScript FundamentalsFunctional JavaScript Fundamentals
Functional JavaScript Fundamentals
 
Ma3696 Lecture 3
Ma3696 Lecture 3Ma3696 Lecture 3
Ma3696 Lecture 3
 

Recently uploaded

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 

Recently uploaded (20)

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 

Intro to Excel VBA Programming

  • 2. Intro to VBA Programming Agenda  Variables    Types Declaration Assignment  Functions/Subroutines   Parameters Returning values  Loops   While For
  • 3. Intro to VBA Programming Agenda  Variables    Types Declaration Assignment  Functions/Subroutines   Parameters Returning values  Loops   While For
  • 4. Intro to VBA Programming  You‟ve seen variables before X =5 Y=X+3  Variables can be reused and changed X =5 X=2 X=X+7  The same principles apply in programming Variables Functions Loops
  • 5. Intro to VBA Programming  Computers are stupid  Must tell them exactly what to do  The more we tell them, the faster they run  Each language does this differently  We will focus on VBA Variables Functions Loops
  • 6. Intro to VBA Programming  All variables should be declared first  This will prevent hard to find errors  It is not required that you do so, but HIGHLY encouraged  To force yourself, use “Option Explicit” at the beginning of VBA files Variables Functions Loops
  • 7. Intro to VBA Programming  To declare a variable in VBA, the basic structure is: Dim <name> as <type> Ex. Dim X as Integer Variables Functions Loops
  • 8. Intro to VBA Programming  Dim means “new Dimension”  Fancy VBA way of saying new variable  When declaring a variable, you should know what it will be used for  Different variable types are used to store different data Variables Functions Loops
  • 9. Intro to VBA Programming  Types include:  Integer (whole numbers like 3)  Float (decimal numbers like 1.25)  Double (just like float, can store wider range of values)  Characters (like „a‟)  String (a number of characters in a row such as “Ivey”)  MANY Variables more Functions Loops
  • 10. Intro to VBA Programming  Types include:  Integer (whole numbers like 3)  Float (decimal numbers like 1.25)  Double (just like float, can store wider range of values)  Characters (like „a‟)  String (a number of characters in a row such as “Ivey”)  MANY Variables more Functions Loops
  • 11. Intro to VBA Programming  To assign a value to a use the “=“ operator  Ex. Dim x As Integer (declare the variable) x=5 Variables Functions Loops
  • 12. Intro to VBA Programming Agenda  Variables    Types Declaration Assignment  Functions/Subroutines   Parameters Returning values  Loops   While For
  • 13. Intro to VBA Programming Functions  Take in input, process it, and produce output Variables Functions Loops
  • 14. Intro to VBA Programming  Functions  General must also be declared format of function declaration: Function <name>(ByVal <parameterName> As <type>) As <returnType>  Subroutines are declared the same way, but do not have a return type Variables Functions Loops
  • 15. Intro to VBA Programming  ByVal refers to “by value”  This will make a copy of the variable and its value  ByRef could also be used  This  Don‟t will modify the original variable worry too much about this for now Variables Functions Loops
  • 16. Intro to VBA Programming  To explicitly return a value from a function, assign the return value to the function name itself Variables Functions Loops
  • 17. Intro to VBA Programming  Subroutines are the same as functions, except for 2 important differences: 1. They do not have explicit return types 2. They cannot be used directly in the spreadsheet Variables Functions Loops
  • 18. Intro to VBA Programming Agenda  Variables    Types Declaration Assignment  Functions/Subroutines   Parameters Returning values  Loops   While For
  • 19. Intro to VBA Programming Loops  Loops allow us to repeatedly perform the same task easily  There are different kinds of loops including:  While  Until  For Variables Functions Loops
  • 20. Intro to VBA Programming  “While” true  “Until” true loops while a certain condition is loops until a certain condition is  “For” loops for a specified number of iterations Variables Functions Loops
  • 21. Intro to VBA Programming Questions, anyone ?