Build a Solid Foundation With VBA Using Microsoft Office
Lab specifications
Part number: 058 702
For software version: 97 or 2000
Lab length: Half a day
Lab description
Overview:
Students will use Word and Excel to become familiar with VBA programming.Prerequisites: Word Level 1 and Level 2 and Excel Level 1 and Level 2 or equivalent knowledge.
Delivery method: This model supports the Lab instructional method. Using this method, the instructor introduces a business scenario, demonstrates techniques for completing an activity, and then lets students complete the activity.
Target student: Students participating in this Lab should be intermediate level users of both Word and Excel who are motivated to learn VBA programming. They should be familiar with the following:
creating, editing, and saving Excel worksheets and Word documents
switching between applications
recording and using macros (this is desirable, but not required)
Objectives
Upon successful completion of this Lab, students will be able to:
work in the Visual Basic Editor and record macros
define the basic elements of a VBA object model and analyze VBA code
write new Sub procedures and modify existing procedures
create a UserForm and program its controls
Lab content
Lab Activity 1: Get started
What is VBA and why do I care?
The Visual Basic Editor
Don’t make work
Try another macro in Excel
Lab Activity 2: Understand code
Get explanations
Use online references
Work with different applications
A little more code and some lists
Lab Activity 3: Write code
Display a message box
Use variables
Make a procedure accessible
Revise code
Lab Activity 4: Create a form and its code
Start a new form
Add controls
Add the code
Test the code
Show the form