-
Learn to automate routine tasks and customize the functionality of Excel features with this crash course in Visual Basic for Applications (VBA).
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. In this course, Excel expert Curt Frye offers a crash course on VBA, sharing techniques that can help users of Excel 2007 or later get more out of this powerful program. Curt covers creating subroutines and functions to hold code, and provides a solid grounding in the Excel object model. Programming techniques are demonstrated through real-world examples. Exercise files accompany the course.
Overview
Syllabus
-
Introduction
- Dive into using VBA in Excel
- What you should know
- 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
- 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
- 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
- Perform a task when conditions are met using an If...Then statement
- Select which action to take using a Case statement
- 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
- 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
- Turn off screen updating when you run a macro
- Use worksheet functions in a macro
- Acquire values using an input box or message box
- Call a subroutine from another subroutine
- 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
- Apply techniques in a capstone project
- Further information