Description
In this course, you will learn:
- The Visual Basic for Applications (VBA) programming language allows you to automate routine tasks in Excel—and it's not as hard to learn as most people think.
- Creating subroutines and functions to hold code, and provides a solid grounding in the Excel object model.
Syllabus:
- Introduction
- Dive into using VBA in Excel
- What you should know
1. Visual Basic for Applications
- Introduce object-oriented programming
- Examine the Excel object model
- Work in the Visual Basic Editor
- Set VBA project properties
- Create, export, and delete code modules
- Create a subroutine
- Create a function
- Add comments to your code
- Run a VBA routine
- Add code to a recorded macro
2. Defining Variables, Constants, and Calculations
- Introduce Excel VBA data types
- Declare variables and require declaration before use
- Manage variable scope
- Define static variables and constants
- Create a calculation using mathematical operators
- Define arrays
- Define and use object variables
- Streamline code references using With…End With statements
3. Adding Logic to Your VBA Code
- Repeat a task using a For...Next loop
- Step through all items of a collection using a For...Each loop
- Repeat a task using a Do loop
- Select which action to take using a Case statement
4. Debugging Your VBA Code
- Manage errors using On Error statements
- Step through a subroutine or function
- Set breakpoints in your code
- Verify output using the Immediate window
- Watch a value in a routine
5. Managing Workbook Elements and Data in VBA
- Write a value to a cell
- Cut, copy, and paste cell data
- Find values in cells
- Refer to cells using the OFFSET function
- Concatenate text strings
- Return part of a string
- Manage worksheets with VBA
- Manage workbooks with VBA
6. Adding Advanced Elements to Your Workbook
- Turn off screen updating when you run a macro
- Use worksheet functions in a macro
- Acquire values using an input box or message box
- Subroutine
7. Using Excel Events in Your VBA Code
- Run a procedure when you open, close, or save a workbook
- Run a procedure when a cell range changes
- Trigger a procedure using a specific key sequence
8. Putting It All Together
- Apply techniques in a capstone project