Page 17 - Excel Progamming Weekend Crash Course
P. 17
540629 FM.qxd 9/2/03 4:10 PM Page xiv
xiv Contents
Using Macros in Programming ................................................................24
Recording a Macro ..............................................................................25
Cell References in Macros .....................................................................26
Viewing and Running Macros .................................................................27
Online Help ......................................................................................27
SESSION 3–The Excel Object Model ...............................................................31
Understanding Properties and Methods ....................................................31
The Importance of Object References .......................................................32
Working with Collections .......................................................................33
The Object Hierarchy .............................................................................35
The Workbook Object ............................................................................36
Creating and Opening Workbooks ...........................................................36
Saving and Closing Workbooks ...............................................................37
Referencing Workbooks ........................................................................38
Printing Workbooks ............................................................................39
E-Mailing a Workbook ..........................................................................39
Other Workbook Methods and Properties ..................................................40
The Worksheet Object ...........................................................................41
Adding and Deleting Worksheets ............................................................41
Referencing Worksheets .......................................................................43
Copying and Moving Worksheets ............................................................44
SESSION 4–Syntax and Data in VBA ..............................................................47
VBA Syntax Fundamentals .....................................................................47
Comments ........................................................................................48
Source Code Formatting .......................................................................49
Employing Constants ............................................................................49
Declaring and Using Variables ................................................................50
Numeric Variables ...............................................................................51
String Variables .................................................................................52
Date Variables ...................................................................................53
Object Variables .................................................................................53
Boolean Variables ...............................................................................54
The Variant Type ................................................................................54
Using Arrays .......................................................................................55
Static Arrays .....................................................................................55
Dynamic Arrays .................................................................................56
User-Defined Types .............................................................................59
Enumerations ....................................................................................60
Understanding Variable Scope ................................................................61
SATURDAY ...............................................................................................66
PART II–Saturday Morning ..................................................................68
SESSION 5–Operators ..................................................................................69
The Assignment Operator ......................................................................69
Numerical Operators .............................................................................70