SlideShare uma empresa Scribd logo
1 de 13
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Learn Excel Macro
Learn Excel Macro  Learn Excel Macro
Learn Excel Macro
 
An introduction to vba and macros
An introduction to vba and macrosAn introduction to vba and macros
An introduction to vba and macros
 
Vba
Vba Vba
Vba
 
Microsoft Excel - Macros
Microsoft Excel - MacrosMicrosoft Excel - Macros
Microsoft Excel - Macros
 
Excel-VBA
Excel-VBAExcel-VBA
Excel-VBA
 
Getting started with Microsoft Excel Macros
Getting started with Microsoft Excel MacrosGetting started with Microsoft Excel Macros
Getting started with Microsoft Excel Macros
 
MACROS excel
MACROS excelMACROS excel
MACROS excel
 
Excel Macro Magic
Excel Macro MagicExcel Macro Magic
Excel Macro Magic
 
Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6
 
Excel
ExcelExcel
Excel
 
Ms access 2010
Ms access 2010Ms access 2010
Ms access 2010
 
Ms excel
Ms excelMs excel
Ms excel
 
Visual Basic Controls ppt
Visual Basic Controls pptVisual Basic Controls ppt
Visual Basic Controls ppt
 
Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)
 
Access 2010 Unit A PPT
Access 2010 Unit A PPTAccess 2010 Unit A PPT
Access 2010 Unit A PPT
 
Ms access
Ms accessMs access
Ms access
 
Ms office (basic) 2016 session 01
Ms office (basic) 2016 session 01Ms office (basic) 2016 session 01
Ms office (basic) 2016 session 01
 
Ms access ppt 2017 by Gopal saha
Ms access ppt 2017 by Gopal sahaMs access ppt 2017 by Gopal saha
Ms access ppt 2017 by Gopal saha
 
Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0
 
MS Access 2010 tutorial 5
MS Access 2010 tutorial 5MS Access 2010 tutorial 5
MS Access 2010 tutorial 5
 

Destaque

Introduction To Excel 2007 Macros
Introduction To Excel 2007 MacrosIntroduction To Excel 2007 Macros
Introduction To Excel 2007 MacrosExcel
 
Visual Basics for Application
Visual Basics for Application Visual Basics for Application
Visual Basics for Application Raghu nath
 
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 calculationsWilliam 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
 
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 CompletionDamien Asseya
 
Belajar macro excel 2007
Belajar macro excel 2007Belajar macro excel 2007
Belajar macro excel 2007doni sandra
 
Introduction To Predictive Analytics Part I
Introduction To Predictive Analytics   Part IIntroduction To Predictive Analytics   Part I
Introduction To Predictive Analytics Part Ijayroy
 
Google Analytics
Google AnalyticsGoogle Analytics
Google AnalyticsRohan Dighe
 

Destaque (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
 
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
 
Google Analytics
Google AnalyticsGoogle Analytics
Google Analytics
 

Semelhante a 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 2Vijay 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.pdfUjwala Junghare
 
Programming basics
Programming basicsProgramming basics
Programming basicsSenri DLN
 
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 1guest38bf
 
Financial modeling sameh aljabli lecture 6
Financial modeling   sameh aljabli   lecture 6Financial modeling   sameh aljabli   lecture 6
Financial modeling sameh aljabli lecture 6Sameh Algabli
 
Visual basic concepts
Visual basic conceptsVisual basic concepts
Visual basic conceptsmelody77776
 
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 basicsmumbahelp
 
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 BeyondRazorleaf 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
 

Semelhante a 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)
 

Mais de Vijay Perepa

Access essential training framework
Access essential training   frameworkAccess essential training   framework
Access essential training frameworkVijay Perepa
 
Add picture to comment
Add picture to commentAdd picture to comment
Add picture to commentVijay Perepa
 
Excel short cut series function keys
Excel short cut series   function keysExcel short cut series   function keys
Excel short cut series function keysVijay Perepa
 
PowerPoint Info-Graphics
PowerPoint Info-GraphicsPowerPoint Info-Graphics
PowerPoint Info-GraphicsVijay 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 themVijay 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 2Vijay 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 valuesVijay 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 5Vijay 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 4Vijay 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 valuesVijay 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 academyVijay Perepa
 
Excel text formulae ameet z academy
Excel text formulae   ameet z academyExcel text formulae   ameet z academy
Excel text formulae ameet z academyVijay 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 keysVijay Perepa
 

Mais de 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
 

Último

Human-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesHuman-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesMohammad Hassany
 
CAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxCAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxSaurabhParmar42
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxDr. Asif Anas
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxAditiChauhan701637
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17Celine George
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesCeline George
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxraviapr7
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICESayali Powar
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfTechSoup
 
How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17Celine George
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxDr. Santhosh Kumar. N
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...raviapr7
 
Diploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfDiploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfMohonDas
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17Celine George
 
The Singapore Teaching Practice document
The Singapore Teaching Practice documentThe Singapore Teaching Practice document
The Singapore Teaching Practice documentXsasf Sfdfasd
 
Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.raviapr7
 
How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17Celine George
 
Patterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxPatterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxMYDA ANGELICA SUAN
 
UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024UKCGE
 
How to Solve Singleton Error in the Odoo 17
How to Solve Singleton Error in the  Odoo 17How to Solve Singleton Error in the  Odoo 17
How to Solve Singleton Error in the Odoo 17Celine George
 

Último (20)

Human-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming ClassesHuman-AI Co-Creation of Worked Examples for Programming Classes
Human-AI Co-Creation of Worked Examples for Programming Classes
 
CAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxCAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptx
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptx
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptx
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 Sales
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptx
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICE
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
 
How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptx
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...
 
Diploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfDiploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdf
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17
 
The Singapore Teaching Practice document
The Singapore Teaching Practice documentThe Singapore Teaching Practice document
The Singapore Teaching Practice document
 
Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.
 
How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17
 
Patterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxPatterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptx
 
UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024
 
How to Solve Singleton Error in the Odoo 17
How to Solve Singleton Error in the  Odoo 17How to Solve Singleton Error in the  Odoo 17
How to Solve Singleton Error in the Odoo 17
 

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