Excel Windows 7: Macro Programming

Course Code: EXCW7-M
Time: 7 hours
Prerequisites: Excel Windows 7: Intermediate
Macro Basics
What is a Macro?
Recording a Macro
Running a Macro
The Macro Module
Macro Comments
Sub procedures
Statements
The Visual Basic Toolbar
Relative vs Absolute Recording
Observing the differences in code
Macro Playback Variations
Shortcut Keys
Command buttons
Toolbar buttons
The Menu Editor
Macro Creation Techniques
Adding a Macro Module Sheet
Recording at the mark
Moving Around the Modules
Keyboard Movement Keys
The Object Browser

Writing Macro Code
Understanding VBA Statements.
Getting Help on VBA code
User Defined Functions
Function Structure
Creating Your Own Functions
A Word About Syntax
Using Constants
Decision Making Macro Code
If ... Then ... Else
Select Case
Loops
For...Next Loop
Do... Loops
For...Each...Next Loops
Creating Variables
Different Way to Enter Data
Select Vs. Activate
A Note on Our Example Macros
Worksheet Functions in Macro Code

Interactive Macros
Macros That Talk!
Message Boxes
A Simple Message Box
Named Arguments
Warning or Choice Message Boxes
The Buttons Argument
Responding to The Message Box
Input Boxes
Using the Chr() function
Custom Dialog Boxes
Create The Dialog Sheet
Size the dialog box
Add/Position Dialog Box Controls
Name the Controls
Test the Dialog Box for Usability
Code for the Dialog Objects
Programming Notes
Debugging
Language Errors
Run-Time Errors
Logical Errors
The Debug Window
Step Into and Step Over

Libraries & Automatic Macros
Macro Libraries
Activating A Library at Startup
Auto Run macros

Return to Course Listing | Home Page