Course Overview
This course introduces you to Excel Macro programming using Microsoft's Visual Basic for Applications (VBA). The overall focus of this course is to teach you proper Visual Basic programming techniques along with an understanding of Excel's object structure. Other topics in this course include recording macros, programming basics, proper variable declaration, Visual Basic functions, control structure use, looping, and UserForm creation. The final section deals with the debugging tools included in the Microsoft VBA editor and methods on how to effectively use them.
Course Objectives
Understanding the Excel Object Model, Creating Recorded Macros, Understanding the Visual Basic Editor, Understanding Programming Basics, Using Visual Basic Functions, Working with Control Structures, Creating UserForms, Debugging Your Macros
Course Prerequisites
There are no prerequisites for this course.
Agenda
1 - Introduction
2 - Understanding the Excel Object Model
- Understanding Objects
- Referencing Workbooks, Worksheets, and Cells
3 - Creating Recorded Macros
- Displaying the Developer Tab
- Setting Macro Trust within Excel
- Recording a Macro
- Running a Macro
- Editing a Macro with the Visual Basic Editor
4 - Understanding the Visual Basic Editor
- Examining the VBA Editor Menu and Toolbar
- Setting VBA Editor Options
- Reviewing the Project Explorer
- Reviewing the Properties Window
- Understanding the Object and Procedure Drop-Down Lists
- Viewing the Immediate Window
- Viewing the Object Browser
5 - Understanding Programming Basics
- Understanding Functions and Procedures
- Dimensioning Variables
- Understanding Object Variables
- Understanding Variables and Scope
- Commenting Your Code
- Creating Constants
- Manipulating Data
- Understanding Procedure Arguments
6 - Using Visual Basic Functions
- Using the InputBox() Function
- Understanding the MsgBox() Function
- Using String Functions
- Using Date Functions
7 - Working with Control Structures
- Using If/Then/Else
- Creating a Select/Case Statement
- Understanding Logical Operators
- Creating For/Next Loops
- Creating Do Loops
- Creating While/Wend Loops
8 - Creating UserForms
- Understanding UserForms
- Understanding Controls
- Setting Control Properties
- Referencing Controls in VBA Code
- Responding to Events
- Creating a Function to Open a UserForm
- Development Tips
9 - Debugging Your Macros
- Understanding Logic Errors and Syntax Errors
- Running Your Macro from the VBA Editor
- Setting Breakpoints
- Stepping Through Your Macro
- Creating Watches
- Adding Error Trapping
10 - Conclusion