Page 18 - Excel Progamming Weekend Crash Course
P. 18
540629 FM.qxd 9/2/03 4:10 PM Page xv
Contents xv
String Operators ...................................................................................71
Logical Operators .................................................................................71
Comparison Operators ...........................................................................72
Operator Precedence .............................................................................74
SESSION 6–Control Constructs .....................................................................77
The If...Then Statement .........................................................................78
The Select Case Statement ......................................................................80
The Do...Loop Statement ........................................................................81
The For...Next Statement .......................................................................83
The For Each...Next Statement ................................................................84
The Goto Statement ..............................................................................85
SESSION 7–Procedures and Modules .............................................................87
Sub Procedures ....................................................................................88
Procedure Arguments ..........................................................................89
Optional Arguments ........................................................................89
ParamArray Arguments ....................................................................90
ByVal and ByRef Arguments ...............................................................90
Calling Procedures ..............................................................................91
Argument Type Checking .....................................................................92
Function Procedures .............................................................................93
Variables in Procedures .........................................................................94
Procedure Scope ...................................................................................95
Storing Procedures ...............................................................................95
SESSION 8–Working with Dates and Times ....................................................97
The Date Data Type ...............................................................................97
Date/Time Values .................................................................................98
Date Calculations ..................................................................................99
Date and Time Details .........................................................................100
Formatting Date/Time Values ................................................................103
SESSION 9–Working with Text ....................................................................107
Text Input and Output .........................................................................107
The MsgBox Function ........................................................................107
InputBox Function ............................................................................110
Searching for Text ..............................................................................111
Comparing Strings ..............................................................................112
String Conversions ..............................................................................112
The StrConv Function ........................................................................112
The LCase and UCase Functions ............................................................113
The Val Function ..............................................................................113
The Str Function ..............................................................................114
Working with ASCII Values ...................................................................114
The Asc, AscB, and AscW Functions .......................................................115
The Chr Function ..............................................................................117
Extracting or Modifying Parts of Strings .................................................117
The Left and Right Functions ...............................................................117
The Mid Function .............................................................................118