SlideShare a Scribd company logo
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 (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
Vijay Perepa
 
Vba Class Level 1
Vba Class Level 1Vba Class Level 1
Vba Class Level 1
Ben Miu CIM® FCSI A+
 
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
Vijay Perepa
 
Vba introduction
Vba introductionVba introduction
Vba introduction
Sandesh DJSAS Singh
 
Excel VBA programming basics
Excel VBA programming basicsExcel VBA programming basics
Excel VBA programming basics
Hang 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 1
Vijay Perepa
 
Vba
Vba Vba
Vba
Juhi Mahajan
 
Excel vba
Excel vbaExcel vba
Excel vba
Almeda Asuncion
 
VBA
VBAVBA
VBA
Tekish
 
Transforming Power Point Show with VBA
Transforming Power Point Show with VBATransforming Power Point Show with VBA
Transforming Power Point Show with VBA
DCPS
 
Vba Class Level 3
Vba Class Level 3Vba Class Level 3
Vba Class Level 3
Ben Miu CIM® FCSI A+
 
Advance MS Excel
Advance MS ExcelAdvance MS Excel
Advance MS Excel
acute23
 
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
Dan 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 Vba
Chester 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 1
guest38bf
 
07 java variables
07   java variables07   java variables
07 java variables
Zeeshan-Shaikh
 
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
quest2900
 
Fieldsymbols
FieldsymbolsFieldsymbols
Fieldsymbols
Nrushing Nayak
 
Operators in java By cheena
Operators in java By cheenaOperators in java By cheena
Operators in java By cheena
Chëëñå Båbü
 
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
Vijay 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 2
Vijay Perepa
 
Excel VBA programming basics
Excel VBA programming basicsExcel VBA programming basics
Excel VBA programming basics
Hang 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 1
Vijay Perepa
 
Transforming Power Point Show with VBA
Transforming Power Point Show with VBATransforming Power Point Show with VBA
Transforming Power Point Show with VBA
DCPS
 
Advance MS Excel
Advance MS ExcelAdvance MS Excel
Advance MS Excel
acute23
 
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
Dan 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 Vba
Chester 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 1
guest38bf
 
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
quest2900
 

Similar to Intro to Excel VBA Programming (20)

Excel 2016 VBA PPT Slide Deck - For Basic to Adavance VBA Learning
Excel 2016 VBA PPT Slide Deck - For Basic to Adavance VBA LearningExcel 2016 VBA PPT Slide Deck - For Basic to Adavance VBA Learning
Excel 2016 VBA PPT Slide Deck - For Basic to Adavance VBA Learning
PrantikMaity6
 
AVB201.1 Microsoft Access VBA Module 1
AVB201.1 Microsoft Access VBA Module 1AVB201.1 Microsoft Access VBA Module 1
AVB201.1 Microsoft Access VBA Module 1
Dan D'Urso
 
Unit 5: Variables
Unit 5: VariablesUnit 5: Variables
Unit 5: Variables
Matthew Campbell, OCT
 
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
DannySingh23
 
Getting started with Microsoft Excel Macros
Getting started with Microsoft Excel MacrosGetting started with Microsoft Excel Macros
Getting started with Microsoft Excel Macros
Nick Weisenberger
 
Financial modeling sameh aljabli lecture 6
Financial modeling   sameh aljabli   lecture 6Financial modeling   sameh aljabli   lecture 6
Financial modeling sameh aljabli lecture 6
Sameh Algabli
 
Excel VBA.pptx
Excel VBA.pptxExcel VBA.pptx
Excel VBA.pptx
GiyaShefin
 
Ma3696 Lecture 3
Ma3696 Lecture 3Ma3696 Lecture 3
Ma3696 Lecture 3
Brunel University
 
Programming inexcelvba anintroduction
Programming inexcelvba anintroductionProgramming inexcelvba anintroduction
Programming inexcelvba anintroduction
Ofun Emma
 
Vbabook ed2
Vbabook ed2Vbabook ed2
Vbabook ed2
NilsonVallecillo
 
Excel-Quick-Reference-Guide.pdf
Excel-Quick-Reference-Guide.pdfExcel-Quick-Reference-Guide.pdf
Excel-Quick-Reference-Guide.pdf
Baojing Shi
 
Excel Vba Basic Tutorial 1
Excel Vba Basic Tutorial 1Excel Vba Basic Tutorial 1
Excel Vba Basic Tutorial 1
rupeshkanu
 
Learn VBA Training & Advance Excel Courses in Delhi
Learn VBA Training & Advance Excel Courses in DelhiLearn VBA Training & Advance Excel Courses in Delhi
Learn VBA Training & Advance Excel Courses in Delhi
ibinstitute0
 
VBA.pptx
VBA.pptxVBA.pptx
VBA.pptx
HarshSharma696023
 
VBA Training Contents
VBA Training ContentsVBA Training Contents
VBA Training Contents
Gaurav Jain
 
ExcelMacrosAndVBA-PP.pptx rqererrwtwtwtwe
ExcelMacrosAndVBA-PP.pptx rqererrwtwtwtweExcelMacrosAndVBA-PP.pptx rqererrwtwtwtwe
ExcelMacrosAndVBA-PP.pptx rqererrwtwtwtwe
sahilvichare266
 
VBA
VBAVBA
VBA
Rohit Garg
 
MA3696 Lecture 9
MA3696 Lecture 9MA3696 Lecture 9
MA3696 Lecture 9
Brunel University
 
Vba primer
Vba primerVba primer
Vba primer
Ofun Emma
 
Ppt lesson 05
Ppt lesson 05Ppt lesson 05
Ppt lesson 05
Linda Bodrie
 
Excel 2016 VBA PPT Slide Deck - For Basic to Adavance VBA Learning
Excel 2016 VBA PPT Slide Deck - For Basic to Adavance VBA LearningExcel 2016 VBA PPT Slide Deck - For Basic to Adavance VBA Learning
Excel 2016 VBA PPT Slide Deck - For Basic to Adavance VBA Learning
PrantikMaity6
 
AVB201.1 Microsoft Access VBA Module 1
AVB201.1 Microsoft Access VBA Module 1AVB201.1 Microsoft Access VBA Module 1
AVB201.1 Microsoft Access VBA Module 1
Dan D'Urso
 
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
DannySingh23
 
Getting started with Microsoft Excel Macros
Getting started with Microsoft Excel MacrosGetting started with Microsoft Excel Macros
Getting started with Microsoft Excel Macros
Nick Weisenberger
 
Financial modeling sameh aljabli lecture 6
Financial modeling   sameh aljabli   lecture 6Financial modeling   sameh aljabli   lecture 6
Financial modeling sameh aljabli lecture 6
Sameh Algabli
 
Excel VBA.pptx
Excel VBA.pptxExcel VBA.pptx
Excel VBA.pptx
GiyaShefin
 
Programming inexcelvba anintroduction
Programming inexcelvba anintroductionProgramming inexcelvba anintroduction
Programming inexcelvba anintroduction
Ofun Emma
 
Excel-Quick-Reference-Guide.pdf
Excel-Quick-Reference-Guide.pdfExcel-Quick-Reference-Guide.pdf
Excel-Quick-Reference-Guide.pdf
Baojing Shi
 
Excel Vba Basic Tutorial 1
Excel Vba Basic Tutorial 1Excel Vba Basic Tutorial 1
Excel Vba Basic Tutorial 1
rupeshkanu
 
Learn VBA Training & Advance Excel Courses in Delhi
Learn VBA Training & Advance Excel Courses in DelhiLearn VBA Training & Advance Excel Courses in Delhi
Learn VBA Training & Advance Excel Courses in Delhi
ibinstitute0
 
VBA Training Contents
VBA Training ContentsVBA Training Contents
VBA Training Contents
Gaurav Jain
 
ExcelMacrosAndVBA-PP.pptx rqererrwtwtwtwe
ExcelMacrosAndVBA-PP.pptx rqererrwtwtwtweExcelMacrosAndVBA-PP.pptx rqererrwtwtwtwe
ExcelMacrosAndVBA-PP.pptx rqererrwtwtwtwe
sahilvichare266
 
Ad

Recently uploaded (20)

Overview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo SlidesOverview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo Slides
Celine George
 
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_HyderabadWebcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Veera Pallapu
 
Exploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle SchoolExploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle School
Marie
 
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptxRai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Dr. Ravi Shankar Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
ABCs of Bookkeeping for Nonprofits TechSoup.pdfABCs of Bookkeeping for Nonprofits TechSoup.pdf
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
TechSoup
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdfGEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil DisobediencePaper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Rajdeep Bavaliya
 
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition OecdEnergy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
razelitouali
 
IDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptxIDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptx
ArneeAgligar
 
LDMMIA Spring Ending Guest Grad Student News
LDMMIA Spring Ending Guest Grad Student NewsLDMMIA Spring Ending Guest Grad Student News
LDMMIA Spring Ending Guest Grad Student News
LDM & Mia eStudios
 
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Rajdeep Bavaliya
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptxFinal Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18
Celine George
 
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition IILDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDM & Mia eStudios
 
BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptxBINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdfUnit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti MpdBasic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Pragya - UEM Kolkata Quiz Club
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
Overview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo SlidesOverview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo Slides
Celine George
 
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_HyderabadWebcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Veera Pallapu
 
Exploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle SchoolExploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle School
Marie
 
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
ABCs of Bookkeeping for Nonprofits TechSoup.pdfABCs of Bookkeeping for Nonprofits TechSoup.pdf
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
TechSoup
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdfGEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil DisobediencePaper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Rajdeep Bavaliya
 
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition OecdEnergy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
razelitouali
 
IDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptxIDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptx
ArneeAgligar
 
LDMMIA Spring Ending Guest Grad Student News
LDMMIA Spring Ending Guest Grad Student NewsLDMMIA Spring Ending Guest Grad Student News
LDMMIA Spring Ending Guest Grad Student News
LDM & Mia eStudios
 
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Rajdeep Bavaliya
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptxFinal Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18
Celine George
 
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition IILDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDM & Mia eStudios
 
BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptxBINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdfUnit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti MpdBasic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Battle of Bookworms 2025 - U25 Literature Quiz by Pragya
Pragya - UEM Kolkata Quiz Club
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
Ad

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 ?