SlideShare a Scribd company logo
What is VBA?
• VBA stands for Visual Basic for Applications. It is a combination
of the Microsoft's event-driven programming language Visual
Basic with Microsoft Office Applications such as Microsoft Excel.
• VBA enables you to automate various activities in Excel like
generating reports, preparing charts & graphs, doing calculations,
etc. This automation activity is also often referred as Macro. This
way it helps users to save their time spent behind running the
repetitive steps.
Uses of VBA
Personal & Business Applications of VBA in Excel
• For personal use, you can use it for simple macros that will
automate most of your routine tasks.
• For business use, you can create complete powerful programs
powered by excel and VBA. The advantage of this approach is you
can leverage the powerful features of excel in your own custom
programs.
• Analyze huge amounts of data
• Finance professionals, such as portfolio managers, financial
analysts, traders, and investment bankers often need to deal with
large volumes of data.
Create and maintain complex models
• Finance professionals can also use VBA to create trading,
pricing, and risk management models.
Create investment scenarios
• Investment bankers and financial analysts often need to make
decisions by comparing two or more investment scenarios. For
example, in mergers and acquisitions, finance professionals must
consider the financial impact of the merger to determine if it is
feasible.
Basics of VBA
Variable –where x = 1 and y = 3. In this expression, x and y are
variables. They can be assigned any numbers i.e. 1 and 3 respective as
in this example. Variables in short are memory locations.
Rules for creating variables
• Don't use reserved words
• Variable names cannot contain spaces
• Use descriptive names
 Arithmetic operators - The rules of Brackets of Division
Multiplication Addition and Subtraction (BODMAS) apply so
remember to apply them when working with expressions that
use multiple different arithmetic operators. Just like in excel,
you can use
o + for addition
o - for subtraction
o * for multiplication
o / for division.
Logical operators –
These include
o If statements
o OR
o NOT
o AND
o TRUE
o FALSE
•
Step by Step process to enable the Developer tab
The step by step process on how to enable the developer tab in
Excel:
• Create a new workbook
• Click on the ribbon start button
• Select options
• Click on customize ribbon
• Select the developer checkbox as shown in the image below
• Click OK
• Enable Developer Option
• To execute VBA program, you have to have access to developer
Excel. Enable the developer option as shown in the below Excel
example and pin it into your main ribbon in Excel.
• Step 1)Go to main menu "FILE"
• Select option "Options."
• Step 2) Now another window will open, in that window do following
things
• Click on Customize Ribbon
• Mark the checker box for Developer option
• Click on OK button
• Step 3) Developer Tab
• You will now be able to see the DEVELOPER tab in the ribbon
• Step 4 − Click the 'Visual Basic' button to open the VBA Editor.
• Step 5 − Start scripting by adding a button. Click Insert → Select the
button.
• Step 6 − Perform a right-click and choose 'properties'.
• Step 7 − Edit the name and caption as shown in the following
screenshot.
Step 8 − Now double-click the button and the sub-procedure outline will
be displayed as shown in the following screenshot.
• Step 9 − Start coding by simply adding a message.
• Step 10 − Click the button to execute the sub-procedure. The output
of the sub-procedure is shown in the following screenshot. Make
sure that you do have design mode turned on. Simply click it to turn
it on if it is not on.

More Related Content

What's hot

La5 Program Phases
La5 Program PhasesLa5 Program Phases
La5 Program Phases
Cma Mohd
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
Ashesh R
 
Programming Theory
Programming TheoryProgramming Theory
Programming Theory
iarthur
 
Program logic formulation
Program logic formulationProgram logic formulation
Program logic formulation
Sara Corpuz
 

What's hot (20)

Computer Program- Introduction, characteristics and stages
Computer Program- Introduction, characteristics and stagesComputer Program- Introduction, characteristics and stages
Computer Program- Introduction, characteristics and stages
 
Error Correction Techniques
Error Correction TechniquesError Correction Techniques
Error Correction Techniques
 
Problem Solving Techniques and Introduction to C
Problem Solving Techniques and Introduction to CProblem Solving Techniques and Introduction to C
Problem Solving Techniques and Introduction to C
 
Program design and problem solving techniques
Program design and problem solving techniquesProgram design and problem solving techniques
Program design and problem solving techniques
 
Algorithms and flow charts
Algorithms and flow chartsAlgorithms and flow charts
Algorithms and flow charts
 
Fundamental Programming Lect 1
Fundamental Programming Lect 1Fundamental Programming Lect 1
Fundamental Programming Lect 1
 
Compiler design error handling
Compiler design error handlingCompiler design error handling
Compiler design error handling
 
Introduction to problem solving in C
Introduction to problem solving in CIntroduction to problem solving in C
Introduction to problem solving in C
 
La5 Program Phases
La5 Program PhasesLa5 Program Phases
La5 Program Phases
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
 
Software Development Life Cycle
Software Development Life CycleSoftware Development Life Cycle
Software Development Life Cycle
 
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision tableProgramming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision table
 
Chap1
Chap1Chap1
Chap1
 
Introduction to problem solving in c++
Introduction to problem solving in c++Introduction to problem solving in c++
Introduction to problem solving in c++
 
Programming Theory
Programming TheoryProgramming Theory
Programming Theory
 
The Programming Process
The Programming ProcessThe Programming Process
The Programming Process
 
Into To Solve Problem And Computer Programming
Into To Solve Problem And Computer ProgrammingInto To Solve Problem And Computer Programming
Into To Solve Problem And Computer Programming
 
Program logic formulation
Program logic formulationProgram logic formulation
Program logic formulation
 
Software Development
Software DevelopmentSoftware Development
Software Development
 

Similar to Unit ii introduction to vba

1 ACC ACF 2400 – Semester 2, 2017 Individual Assignm.docx
1  ACC ACF 2400 – Semester 2, 2017  Individual Assignm.docx1  ACC ACF 2400 – Semester 2, 2017  Individual Assignm.docx
1 ACC ACF 2400 – Semester 2, 2017 Individual Assignm.docx
honey725342
 

Similar to Unit ii introduction to vba (20)

Vbabook ed2
Vbabook ed2Vbabook ed2
Vbabook ed2
 
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
 
Excel Macros and VBA Programming Training Bangalore:
Excel Macros and VBA Programming Training Bangalore:Excel Macros and VBA Programming Training Bangalore:
Excel Macros and VBA Programming Training Bangalore:
 
Online Advance Excel & VBA Training in India
 Online Advance Excel & VBA Training in India Online Advance Excel & VBA Training in India
Online Advance Excel & VBA Training in India
 
VT University Live Session 3
VT University Live Session 3VT University Live Session 3
VT University Live Session 3
 
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
 
Excel ch10
Excel ch10Excel ch10
Excel ch10
 
1 ACC ACF 2400 – Semester 2, 2017 Individual Assignm.docx
1  ACC ACF 2400 – Semester 2, 2017  Individual Assignm.docx1  ACC ACF 2400 – Semester 2, 2017  Individual Assignm.docx
1 ACC ACF 2400 – Semester 2, 2017 Individual Assignm.docx
 
Leveraging IBM Cognos TM1 for Merchandise Planning at Tractor Supply Company ...
Leveraging IBM Cognos TM1 for Merchandise Planning at Tractor Supply Company ...Leveraging IBM Cognos TM1 for Merchandise Planning at Tractor Supply Company ...
Leveraging IBM Cognos TM1 for Merchandise Planning at Tractor Supply Company ...
 
How to create macro with example
How to create macro with exampleHow to create macro with example
How to create macro with example
 
SYSTEM APPLICATION PRODUCTS AND DATA PROCESING
SYSTEM APPLICATION PRODUCTS AND DATA PROCESINGSYSTEM APPLICATION PRODUCTS AND DATA PROCESING
SYSTEM APPLICATION PRODUCTS AND DATA PROCESING
 
Creating reports in oracle e business suite using xml publisher
Creating reports in oracle e business suite using xml publisherCreating reports in oracle e business suite using xml publisher
Creating reports in oracle e business suite using xml publisher
 
Microsoft Excel Tutorial
Microsoft Excel TutorialMicrosoft Excel Tutorial
Microsoft Excel Tutorial
 
VBA Tips
VBA TipsVBA Tips
VBA Tips
 
AXUG Summit 2016 Budget planning session
AXUG Summit 2016 Budget planning sessionAXUG Summit 2016 Budget planning session
AXUG Summit 2016 Budget planning session
 
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
 
Lab5 RTC reports and Dashboards
Lab5 RTC reports and DashboardsLab5 RTC reports and Dashboards
Lab5 RTC reports and Dashboards
 
Q1 Deltek Vision User Group Meeting
Q1 Deltek Vision User Group MeetingQ1 Deltek Vision User Group Meeting
Q1 Deltek Vision User Group Meeting
 
MS Excel Macros/ VBA Project report
MS Excel Macros/ VBA Project reportMS Excel Macros/ VBA Project report
MS Excel Macros/ VBA Project report
 
Feature Scoring in Green Field Application Development and DevOps
Feature Scoring in Green Field Application Development and DevOpsFeature Scoring in Green Field Application Development and DevOps
Feature Scoring in Green Field Application Development and DevOps
 

Recently uploaded

Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 

Recently uploaded (20)

How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & EngineeringBasic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
Basic Civil Engg Notes_Chapter-6_Environment Pollution & Engineering
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational ResourcesBenefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resources
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptx
 
Forest and Wildlife Resources Class 10 Free Study Material PDF
Forest and Wildlife Resources Class 10 Free Study Material PDFForest and Wildlife Resources Class 10 Free Study Material PDF
Forest and Wildlife Resources Class 10 Free Study Material PDF
 
Salient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxSalient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptx
 
B.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdfB.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdf
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
The Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational ResourcesThe Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational Resources
 

Unit ii introduction to vba

  • 1. What is VBA? • VBA stands for Visual Basic for Applications. It is a combination of the Microsoft's event-driven programming language Visual Basic with Microsoft Office Applications such as Microsoft Excel. • VBA enables you to automate various activities in Excel like generating reports, preparing charts & graphs, doing calculations, etc. This automation activity is also often referred as Macro. This way it helps users to save their time spent behind running the repetitive steps.
  • 2. Uses of VBA Personal & Business Applications of VBA in Excel • For personal use, you can use it for simple macros that will automate most of your routine tasks. • For business use, you can create complete powerful programs powered by excel and VBA. The advantage of this approach is you can leverage the powerful features of excel in your own custom programs. • Analyze huge amounts of data • Finance professionals, such as portfolio managers, financial analysts, traders, and investment bankers often need to deal with large volumes of data.
  • 3. Create and maintain complex models • Finance professionals can also use VBA to create trading, pricing, and risk management models. Create investment scenarios • Investment bankers and financial analysts often need to make decisions by comparing two or more investment scenarios. For example, in mergers and acquisitions, finance professionals must consider the financial impact of the merger to determine if it is feasible.
  • 4. Basics of VBA Variable –where x = 1 and y = 3. In this expression, x and y are variables. They can be assigned any numbers i.e. 1 and 3 respective as in this example. Variables in short are memory locations. Rules for creating variables • Don't use reserved words • Variable names cannot contain spaces • Use descriptive names
  • 5.  Arithmetic operators - The rules of Brackets of Division Multiplication Addition and Subtraction (BODMAS) apply so remember to apply them when working with expressions that use multiple different arithmetic operators. Just like in excel, you can use o + for addition o - for subtraction o * for multiplication o / for division.
  • 6. Logical operators – These include o If statements o OR o NOT o AND o TRUE o FALSE •
  • 7. Step by Step process to enable the Developer tab The step by step process on how to enable the developer tab in Excel: • Create a new workbook • Click on the ribbon start button • Select options • Click on customize ribbon • Select the developer checkbox as shown in the image below • Click OK
  • 8. • Enable Developer Option • To execute VBA program, you have to have access to developer Excel. Enable the developer option as shown in the below Excel example and pin it into your main ribbon in Excel. • Step 1)Go to main menu "FILE" • Select option "Options."
  • 9.
  • 10. • Step 2) Now another window will open, in that window do following things • Click on Customize Ribbon • Mark the checker box for Developer option • Click on OK button
  • 11.
  • 12. • Step 3) Developer Tab • You will now be able to see the DEVELOPER tab in the ribbon
  • 13. • Step 4 − Click the 'Visual Basic' button to open the VBA Editor.
  • 14. • Step 5 − Start scripting by adding a button. Click Insert → Select the button.
  • 15. • Step 6 − Perform a right-click and choose 'properties'.
  • 16. • Step 7 − Edit the name and caption as shown in the following screenshot.
  • 17. Step 8 − Now double-click the button and the sub-procedure outline will be displayed as shown in the following screenshot.
  • 18. • Step 9 − Start coding by simply adding a message. • Step 10 − Click the button to execute the sub-procedure. The output of the sub-procedure is shown in the following screenshot. Make sure that you do have design mode turned on. Simply click it to turn it on if it is not on.