SlideShare a Scribd company logo
Ameetz.com What is VBA? Visual Basic for Applications (VBA) is an extensible programming language that is made up of a core set of commands and extended on a per-application basis to be able to work directly with objects in that application. This means that VBA for Excel knows about things like workbooks, worksheets, cells and charts and more;  VBA can probably be best described as an object-based (but not a true object oriented) language that is event driven. Let’s look at the event driven side of it first.
Ameetz.com EVENT DRIVEN LANGUAGE  Event driven means that nothing happens until something happens. In VBA, no code executes except in response to some event taking place (or at the command of the code once it is started by some event). An event can be any one of many things. Opening an Excel workbook creates, or  triggers, the Open event, closing it triggers the Before Close event. OBJECT-BASED LANGUAGE  Object based means that when referring to the components of the application, things like workbooks, worksheets, cells, charts, etc. are ‘objects’.
Ameetz.com An object has certain attributes. Just a a person has attributes like height, weight, eye and hair color, the objects in Excel have attributes (Properties) such as value, height, width, color and more. Additionally, objects can do things or have things done to them – these actions are known as Methods. For example, a workbook can be opened or closed; a cell can have its shading altered, a worksheet can be deleted.
Ameetz.com The Excel VBA IDE  (Integrated Development Environment)
GETTING TO THE VBA IDE  Your first question may be “How the heck did you get there!?” The quickest way to open the VBA IDE (which I’ll simply call the VBE for Visual Basic Editor for the rest of this document), is to press  [Alt]+[F11] while in the main/normal Excel window. You can also get there from the normal Excel menu via Tools | Macro | Visual Basic Editor:
The VBE menu and normal icon toolbar.  The project Window , If not visible ctrl+R to bring to view The Code window – may be empty, or may be shared for use to display other things such as the Object Browser.  The Properties window – displays and allows editing of the properties of the currently active object.  The Immediate window – you can type in commands, set values, examine values and Debug.Print results show up in this window.
Option Explicit  is a directive to the compiler that says that all user defined constants and variables must be declared before actually using them in the code. The up side of using Option Explicit is that errors in your code due to typographic errors or reuse of a variable as the wrong type are greatly reduced and when it does happen, the problems are more easily identified
To make sure that you don’t forget to always use  Option Explicit,  you can have a ‘permanent’ setting and affects all projects you create in any workbook after making the setting.  Start by selecting [Tools] | Options from the VBE menu toolbar:
This is the dialog that appears once you use [Tools] | Options from the VBE menu toolbar.  Check the “Require Variable Declaration” box to set up the VBE to always place the  Option Explicit  statement at the beginning of all new code modules in the future.
Code Modules ,[object Object],[object Object],[object Object],[object Object],General Purpose Code Modules These are code modules you’ll bring into existence and can contain code to do almost anything of a ‘general purpose’ nature.  code to respond to custom menus you might develop, user defined functions (UDF) that you develop to perform actions and calculations by way of using the name of the UDF in a worksheet formula just like a built-in Excel worksheet function.  Macros you record are placed into general purpose modules. Recording macros during different sessions with the workbook results in numerous modules that may contain as few as a single procedure (macro) in it. This results in being quite wasteful of resources. All macros recorded during a single session are typically placed into a single module.
WORKBOOK CODE MODULES  There is one and only one code module per workbook that is associated with Workbook Event handling. At the technical level, this module, along with the worksheet event handling modules are Class Modules.
WORKSHEET CODE MODULES  There is one and only one code module per worksheet that is associated with  Worksheet Event handling.  However, each sheet has its very own code module that is separate and distinct from all of the others even though they may all have event handlers for a given event for those worksheets. At the technical level, this module, just like the event handling module for the workbook are Class Modules
End of 1 st  Lesson Next Session  - Procedures – Function and Sub

More Related Content

What's hot

Learn Excel Macro
Learn Excel Macro  Learn Excel Macro
Learn Excel Macro
AbhisheK Kumar Rajoria
 
MACROS excel
MACROS excelMACROS excel
MACROS excel
Zenobia Sukhia
 
Vba part 1
Vba part 1Vba part 1
Vba part 1
Morteza Noshad
 
Basic Functions - Excel 2013 Tutorial
Basic Functions - Excel 2013 TutorialBasic Functions - Excel 2013 Tutorial
Basic Functions - Excel 2013 Tutorial
SpreadsheetTrainer
 
Excel Lecture Notes.ppt
Excel Lecture Notes.pptExcel Lecture Notes.ppt
Excel Lecture Notes.ppt
izzat61
 
50 MS Excel Tips and Tricks
50 MS Excel Tips and Tricks 50 MS Excel Tips and Tricks
50 MS Excel Tips and Tricks
BurCom Consulting Ltd.
 
MS EXCEL
MS EXCELMS EXCEL
MS EXCEL
syed_umar
 
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
 
MS Excel
MS ExcelMS Excel
Excel 2007- Enter Formulas
Excel 2007- Enter FormulasExcel 2007- Enter Formulas
Excel 2007- Enter Formulas
Oklahoma Dept. Mental Health
 
Microsoft Excel
Microsoft ExcelMicrosoft Excel
Microsoft Excel
YasirKhan357
 
An introduction to vba and macros
An introduction to vba and macrosAn introduction to vba and macros
An introduction to vba and macros
Er. Nawaraj Bhandari
 
ms excel presentation...
ms excel presentation...ms excel presentation...
ms excel presentation...
alok1994
 
Advances in ms excel
Advances in ms excelAdvances in ms excel
Advances in ms excelMohit Kumar
 
03 Excel formulas and functions
03 Excel formulas and functions03 Excel formulas and functions
03 Excel formulas and functionsBuffalo Seminary
 
3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.ppt3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.ppt
JosephIThomas
 
Excel-VBA
Excel-VBAExcel-VBA
Excel-VBA
DHRUYEN HADIYA
 
Charts in EXCEL
Charts in EXCELCharts in EXCEL
Charts in EXCEL
pkottke
 
Using the IF Function in Excel
Using the IF Function in ExcelUsing the IF Function in Excel
Using the IF Function in ExcelCasey Robertson
 
Excel lesson01
Excel lesson01Excel lesson01
Excel lesson01
Erik Hardiyanto
 

What's hot (20)

Learn Excel Macro
Learn Excel Macro  Learn Excel Macro
Learn Excel Macro
 
MACROS excel
MACROS excelMACROS excel
MACROS excel
 
Vba part 1
Vba part 1Vba part 1
Vba part 1
 
Basic Functions - Excel 2013 Tutorial
Basic Functions - Excel 2013 TutorialBasic Functions - Excel 2013 Tutorial
Basic Functions - Excel 2013 Tutorial
 
Excel Lecture Notes.ppt
Excel Lecture Notes.pptExcel Lecture Notes.ppt
Excel Lecture Notes.ppt
 
50 MS Excel Tips and Tricks
50 MS Excel Tips and Tricks 50 MS Excel Tips and Tricks
50 MS Excel Tips and Tricks
 
MS EXCEL
MS EXCELMS EXCEL
MS EXCEL
 
Getting started with Microsoft Excel Macros
Getting started with Microsoft Excel MacrosGetting started with Microsoft Excel Macros
Getting started with Microsoft Excel Macros
 
MS Excel
MS ExcelMS Excel
MS Excel
 
Excel 2007- Enter Formulas
Excel 2007- Enter FormulasExcel 2007- Enter Formulas
Excel 2007- Enter Formulas
 
Microsoft Excel
Microsoft ExcelMicrosoft Excel
Microsoft Excel
 
An introduction to vba and macros
An introduction to vba and macrosAn introduction to vba and macros
An introduction to vba and macros
 
ms excel presentation...
ms excel presentation...ms excel presentation...
ms excel presentation...
 
Advances in ms excel
Advances in ms excelAdvances in ms excel
Advances in ms excel
 
03 Excel formulas and functions
03 Excel formulas and functions03 Excel formulas and functions
03 Excel formulas and functions
 
3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.ppt3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.ppt
 
Excel-VBA
Excel-VBAExcel-VBA
Excel-VBA
 
Charts in EXCEL
Charts in EXCELCharts in EXCEL
Charts in EXCEL
 
Using the IF Function in Excel
Using the IF Function in ExcelUsing the IF Function in Excel
Using the IF Function in Excel
 
Excel lesson01
Excel lesson01Excel lesson01
Excel lesson01
 

Viewers also liked

Introduction To Excel 2007 Macros
Introduction To Excel 2007 MacrosIntroduction To Excel 2007 Macros
Introduction To Excel 2007 Macros
Excel
 
eSocial - Plano de Voo Vilesoft
eSocial - Plano de Voo VilesofteSocial - Plano de Voo Vilesoft
eSocial - Plano de Voo Vilesoft
Vilesoft Softwares e Soluções
 
Visual Basics for Application
Visual Basics for Application Visual Basics for Application
Visual Basics for Application Raghu nath
 
Excel y visual basic
Excel y visual basicExcel y visual basic
Excel y visual basic
Egidio Mosquer Copete
 
Vb net xp_10
Vb net xp_10Vb net xp_10
Vb net xp_10Niit Care
 
Notes how to work with variables, constants and do calculations
Notes how to work with variables, constants and do calculationsNotes how to work with variables, constants and do calculations
Notes how to work with variables, constants and do calculations
William Olivier
 
Programming inexcelvba anintroduction
Programming inexcelvba anintroductionProgramming inexcelvba anintroduction
Programming inexcelvba anintroductionOfun Emma
 
Intro macros in Excel 2007
Intro macros in Excel 2007Intro macros in Excel 2007
Intro macros in Excel 2007Hasrudin Tazep
 
The visual elements of an image (english version)
The visual elements of an image (english version)The visual elements of an image (english version)
The visual elements of an image (english version)LARIBERAPLASTICA
 
Google Analytics Overview
Google Analytics OverviewGoogle Analytics Overview
Google Analytics Overview
Anvil Media, Inc.
 
Up and running with VBA in Excel Certificate of Completion
Up and running with VBA in Excel Certificate of CompletionUp and running with VBA in Excel Certificate of Completion
Up and running with VBA in Excel Certificate of Completion
Damien Asseya
 
Vba Class Level 1
Vba Class Level 1Vba Class Level 1
Vba Class Level 1
Ben Miu CIM® FCSI A+
 
Belajar macro excel 2007
Belajar macro excel 2007Belajar macro excel 2007
Belajar macro excel 2007
doni sandra
 
Introduction To Predictive Analytics Part I
Introduction To Predictive Analytics   Part IIntroduction To Predictive Analytics   Part I
Introduction To Predictive Analytics Part I
jayroy
 

Viewers also liked (20)

Excel ch10
Excel ch10Excel ch10
Excel ch10
 
Introduction To Excel 2007 Macros
Introduction To Excel 2007 MacrosIntroduction To Excel 2007 Macros
Introduction To Excel 2007 Macros
 
eSocial - Plano de Voo Vilesoft
eSocial - Plano de Voo VilesofteSocial - Plano de Voo Vilesoft
eSocial - Plano de Voo Vilesoft
 
Visual Basics for Application
Visual Basics for Application Visual Basics for Application
Visual Basics for Application
 
Vba
Vba Vba
Vba
 
Excel y visual basic
Excel y visual basicExcel y visual basic
Excel y visual basic
 
Excel chapter-7
Excel chapter-7Excel chapter-7
Excel chapter-7
 
Vb net xp_10
Vb net xp_10Vb net xp_10
Vb net xp_10
 
Notes how to work with variables, constants and do calculations
Notes how to work with variables, constants and do calculationsNotes how to work with variables, constants and do calculations
Notes how to work with variables, constants and do calculations
 
Programming inexcelvba anintroduction
Programming inexcelvba anintroductionProgramming inexcelvba anintroduction
Programming inexcelvba anintroduction
 
Intro macros in Excel 2007
Intro macros in Excel 2007Intro macros in Excel 2007
Intro macros in Excel 2007
 
The visual elements of an image (english version)
The visual elements of an image (english version)The visual elements of an image (english version)
The visual elements of an image (english version)
 
Microsoft visual basic 6
Microsoft visual basic 6Microsoft visual basic 6
Microsoft visual basic 6
 
Google Analytics Overview
Google Analytics OverviewGoogle Analytics Overview
Google Analytics Overview
 
The Best Source Code VB
The Best Source Code VBThe Best Source Code VB
The Best Source Code VB
 
Up and running with VBA in Excel Certificate of Completion
Up and running with VBA in Excel Certificate of CompletionUp and running with VBA in Excel Certificate of Completion
Up and running with VBA in Excel Certificate of Completion
 
Vba Class Level 1
Vba Class Level 1Vba Class Level 1
Vba Class Level 1
 
Belajar macro excel 2007
Belajar macro excel 2007Belajar macro excel 2007
Belajar macro excel 2007
 
Visual Basic 6.0
Visual Basic 6.0Visual Basic 6.0
Visual Basic 6.0
 
Introduction To Predictive Analytics Part I
Introduction To Predictive Analytics   Part IIntroduction To Predictive Analytics   Part I
Introduction To Predictive Analytics Part I
 

Similar to E learning excel vba programming lesson 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
Vijay Perepa
 
Unit -II Introduction to visual programming.pdf
Unit -II Introduction to visual programming.pdfUnit -II Introduction to visual programming.pdf
Unit -II Introduction to visual programming.pdf
Ujwala Junghare
 
Automating SolidWorks with Excel
Automating SolidWorks with ExcelAutomating SolidWorks with Excel
Automating SolidWorks with Excel
Razorleaf Corporation
 
Programming basics
Programming basicsProgramming basics
Programming basics
Senri DLN
 
Vb lecture
Vb lectureVb lecture
Vb lecture
alldesign
 
Autocad excel vba
Autocad excel vbaAutocad excel vba
Autocad excel vbarjg_vijay
 
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
 
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
 
UNIT I.pptx
UNIT I.pptxUNIT I.pptx
UNIT I.pptx
BhargaviJ8
 
Visual basic concepts
Visual basic conceptsVisual basic concepts
Visual basic concepts
melody77776
 
Mfc programming tutorial automation step by-step
Mfc programming tutorial automation step by-stepMfc programming tutorial automation step by-step
Mfc programming tutorial automation step by-stepnamtranvanpt
 
Plug-in Architectures
Plug-in ArchitecturesPlug-in Architectures
Plug-in Architectureselliando dias
 
Bm0025 visual basic
Bm0025   visual basicBm0025   visual basic
Bm0025 visual basic
smumbahelp
 
Vbabook ed2
Vbabook ed2Vbabook ed2
Vbabook ed2
NilsonVallecillo
 
Ch02 bronson
Ch02 bronsonCh02 bronson
Ch02 bronson
Bharathi N Reddy
 
Sww 2008 Automating Your Designs Excel, Vba And Beyond
Sww 2008   Automating Your Designs   Excel, Vba And BeyondSww 2008   Automating Your Designs   Excel, Vba And Beyond
Sww 2008 Automating Your Designs Excel, Vba And Beyond
Razorleaf Corporation
 
Introduction to visual basic 6 (1)
Introduction to visual basic 6 (1)Introduction to visual basic 6 (1)
Introduction to visual basic 6 (1)Mark Vincent Cantero
 

Similar to E learning excel vba programming lesson 1 (20)

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
 
Unit -II Introduction to visual programming.pdf
Unit -II Introduction to visual programming.pdfUnit -II Introduction to visual programming.pdf
Unit -II Introduction to visual programming.pdf
 
Automating SolidWorks with Excel
Automating SolidWorks with ExcelAutomating SolidWorks with Excel
Automating SolidWorks with Excel
 
Programming basics
Programming basicsProgramming basics
Programming basics
 
Vb lecture
Vb lectureVb lecture
Vb lecture
 
Autocad excel vba
Autocad excel vbaAutocad excel vba
Autocad excel vba
 
Chapter 01
Chapter 01Chapter 01
Chapter 01
 
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
 
Financial modeling sameh aljabli lecture 6
Financial modeling   sameh aljabli   lecture 6Financial modeling   sameh aljabli   lecture 6
Financial modeling sameh aljabli lecture 6
 
UNIT I.pptx
UNIT I.pptxUNIT I.pptx
UNIT I.pptx
 
Visual basic concepts
Visual basic conceptsVisual basic concepts
Visual basic concepts
 
Vb.net ide
Vb.net ideVb.net ide
Vb.net ide
 
Mfc programming tutorial automation step by-step
Mfc programming tutorial automation step by-stepMfc programming tutorial automation step by-step
Mfc programming tutorial automation step by-step
 
Plug-in Architectures
Plug-in ArchitecturesPlug-in Architectures
Plug-in Architectures
 
VBA
VBAVBA
VBA
 
Bm0025 visual basic
Bm0025   visual basicBm0025   visual basic
Bm0025 visual basic
 
Vbabook ed2
Vbabook ed2Vbabook ed2
Vbabook ed2
 
Ch02 bronson
Ch02 bronsonCh02 bronson
Ch02 bronson
 
Sww 2008 Automating Your Designs Excel, Vba And Beyond
Sww 2008   Automating Your Designs   Excel, Vba And BeyondSww 2008   Automating Your Designs   Excel, Vba And Beyond
Sww 2008 Automating Your Designs Excel, Vba And Beyond
 
Introduction to visual basic 6 (1)
Introduction to visual basic 6 (1)Introduction to visual basic 6 (1)
Introduction to visual basic 6 (1)
 

More from Vijay Perepa

Access essential training framework
Access essential training   frameworkAccess essential training   framework
Access essential training framework
Vijay Perepa
 
Add picture to comment
Add picture to commentAdd picture to comment
Add picture to comment
Vijay Perepa
 
Excel short cut series function keys
Excel short cut series   function keysExcel short cut series   function keys
Excel short cut series function keys
Vijay Perepa
 
PowerPoint Info-Graphics
PowerPoint Info-GraphicsPowerPoint Info-Graphics
PowerPoint Info-Graphics
Vijay Perepa
 
Types of charts in Excel and How to use them
Types of charts in Excel and How to use themTypes of charts in Excel and How to use them
Types of charts in Excel and How to use them
Vijay Perepa
 
Pivot table essential learning 1
Pivot table   essential learning 1Pivot table   essential learning 1
Pivot table essential learning 1Vijay Perepa
 
Pivot table essential learning 2
Pivot table   essential learning 2Pivot table   essential learning 2
Pivot table essential learning 2
Vijay Perepa
 
Modeling in microsoft excel
Modeling in microsoft excelModeling in microsoft excel
Modeling in microsoft excelVijay Perepa
 
Understanding excel’s error values
Understanding excel’s error valuesUnderstanding excel’s error values
Understanding excel’s error values
Vijay Perepa
 
Excel training commands not in ribbon
Excel training   commands not in ribbonExcel training   commands not in ribbon
Excel training commands not in ribbonVijay Perepa
 
E learning excel vba programming lesson 5
E learning excel vba programming  lesson 5E learning excel vba programming  lesson 5
E learning excel vba programming lesson 5
Vijay Perepa
 
E learning excel vba programming lesson 4
E learning excel vba programming  lesson 4E learning excel vba programming  lesson 4
E learning excel vba programming lesson 4
Vijay Perepa
 
Pivot table
Pivot tablePivot table
Pivot table
Vijay Perepa
 
Power point short cut keys
Power point short cut keysPower point short cut keys
Power point short cut keysVijay Perepa
 
Understanding excel’s error values
Understanding excel’s error valuesUnderstanding excel’s error values
Understanding excel’s error values
Vijay Perepa
 
Excel information formulae par ii ameet z academy
Excel information formulae par ii  ameet z academyExcel information formulae par ii  ameet z academy
Excel information formulae par ii ameet z academyVijay Perepa
 
Excel information formulae ameet z academy
Excel information formulae   ameet z academyExcel information formulae   ameet z academy
Excel information formulae ameet z academy
Vijay Perepa
 
Excel text formulae ameet z academy
Excel text formulae   ameet z academyExcel text formulae   ameet z academy
Excel text formulae ameet z academy
Vijay Perepa
 
E-Learning from Ameetz (ISERROR formula)
E-Learning from Ameetz (ISERROR formula)E-Learning from Ameetz (ISERROR formula)
E-Learning from Ameetz (ISERROR formula)
Vijay Perepa
 
E learning excel short cut keys
E learning excel short cut keysE learning excel short cut keys
E learning excel short cut keys
Vijay Perepa
 

More from Vijay Perepa (20)

Access essential training framework
Access essential training   frameworkAccess essential training   framework
Access essential training framework
 
Add picture to comment
Add picture to commentAdd picture to comment
Add picture to comment
 
Excel short cut series function keys
Excel short cut series   function keysExcel short cut series   function keys
Excel short cut series function keys
 
PowerPoint Info-Graphics
PowerPoint Info-GraphicsPowerPoint Info-Graphics
PowerPoint Info-Graphics
 
Types of charts in Excel and How to use them
Types of charts in Excel and How to use themTypes of charts in Excel and How to use them
Types of charts in Excel and How to use them
 
Pivot table essential learning 1
Pivot table   essential learning 1Pivot table   essential learning 1
Pivot table essential learning 1
 
Pivot table essential learning 2
Pivot table   essential learning 2Pivot table   essential learning 2
Pivot table essential learning 2
 
Modeling in microsoft excel
Modeling in microsoft excelModeling in microsoft excel
Modeling in microsoft excel
 
Understanding excel’s error values
Understanding excel’s error valuesUnderstanding excel’s error values
Understanding excel’s error values
 
Excel training commands not in ribbon
Excel training   commands not in ribbonExcel training   commands not in ribbon
Excel training commands not in ribbon
 
E learning excel vba programming lesson 5
E learning excel vba programming  lesson 5E learning excel vba programming  lesson 5
E learning excel vba programming lesson 5
 
E learning excel vba programming lesson 4
E learning excel vba programming  lesson 4E learning excel vba programming  lesson 4
E learning excel vba programming lesson 4
 
Pivot table
Pivot tablePivot table
Pivot table
 
Power point short cut keys
Power point short cut keysPower point short cut keys
Power point short cut keys
 
Understanding excel’s error values
Understanding excel’s error valuesUnderstanding excel’s error values
Understanding excel’s error values
 
Excel information formulae par ii ameet z academy
Excel information formulae par ii  ameet z academyExcel information formulae par ii  ameet z academy
Excel information formulae par ii ameet z academy
 
Excel information formulae ameet z academy
Excel information formulae   ameet z academyExcel information formulae   ameet z academy
Excel information formulae ameet z academy
 
Excel text formulae ameet z academy
Excel text formulae   ameet z academyExcel text formulae   ameet z academy
Excel text formulae ameet z academy
 
E-Learning from Ameetz (ISERROR formula)
E-Learning from Ameetz (ISERROR formula)E-Learning from Ameetz (ISERROR formula)
E-Learning from Ameetz (ISERROR formula)
 
E learning excel short cut keys
E learning excel short cut keysE learning excel short cut keys
E learning excel short cut keys
 

Recently uploaded

Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
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
Tamralipta Mahavidyalaya
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 

Recently uploaded (20)

Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
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
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 

E learning excel vba programming lesson 1

  • 1. Ameetz.com What is VBA? Visual Basic for Applications (VBA) is an extensible programming language that is made up of a core set of commands and extended on a per-application basis to be able to work directly with objects in that application. This means that VBA for Excel knows about things like workbooks, worksheets, cells and charts and more; VBA can probably be best described as an object-based (but not a true object oriented) language that is event driven. Let’s look at the event driven side of it first.
  • 2. Ameetz.com EVENT DRIVEN LANGUAGE Event driven means that nothing happens until something happens. In VBA, no code executes except in response to some event taking place (or at the command of the code once it is started by some event). An event can be any one of many things. Opening an Excel workbook creates, or triggers, the Open event, closing it triggers the Before Close event. OBJECT-BASED LANGUAGE Object based means that when referring to the components of the application, things like workbooks, worksheets, cells, charts, etc. are ‘objects’.
  • 3. Ameetz.com An object has certain attributes. Just a a person has attributes like height, weight, eye and hair color, the objects in Excel have attributes (Properties) such as value, height, width, color and more. Additionally, objects can do things or have things done to them – these actions are known as Methods. For example, a workbook can be opened or closed; a cell can have its shading altered, a worksheet can be deleted.
  • 4. Ameetz.com The Excel VBA IDE (Integrated Development Environment)
  • 5. GETTING TO THE VBA IDE Your first question may be “How the heck did you get there!?” The quickest way to open the VBA IDE (which I’ll simply call the VBE for Visual Basic Editor for the rest of this document), is to press [Alt]+[F11] while in the main/normal Excel window. You can also get there from the normal Excel menu via Tools | Macro | Visual Basic Editor:
  • 6. The VBE menu and normal icon toolbar. The project Window , If not visible ctrl+R to bring to view The Code window – may be empty, or may be shared for use to display other things such as the Object Browser. The Properties window – displays and allows editing of the properties of the currently active object. The Immediate window – you can type in commands, set values, examine values and Debug.Print results show up in this window.
  • 7. Option Explicit is a directive to the compiler that says that all user defined constants and variables must be declared before actually using them in the code. The up side of using Option Explicit is that errors in your code due to typographic errors or reuse of a variable as the wrong type are greatly reduced and when it does happen, the problems are more easily identified
  • 8. To make sure that you don’t forget to always use Option Explicit, you can have a ‘permanent’ setting and affects all projects you create in any workbook after making the setting. Start by selecting [Tools] | Options from the VBE menu toolbar:
  • 9. This is the dialog that appears once you use [Tools] | Options from the VBE menu toolbar. Check the “Require Variable Declaration” box to set up the VBE to always place the Option Explicit statement at the beginning of all new code modules in the future.
  • 10.
  • 11. WORKBOOK CODE MODULES There is one and only one code module per workbook that is associated with Workbook Event handling. At the technical level, this module, along with the worksheet event handling modules are Class Modules.
  • 12. WORKSHEET CODE MODULES There is one and only one code module per worksheet that is associated with Worksheet Event handling. However, each sheet has its very own code module that is separate and distinct from all of the others even though they may all have event handlers for a given event for those worksheets. At the technical level, this module, just like the event handling module for the workbook are Class Modules
  • 13. End of 1 st Lesson Next Session - Procedures – Function and Sub