Page 145 - Excel Progamming Weekend Crash Course
P. 145

h540629 ch09.qxd  9/2/03  9:34 AM  Page 120




                120                                                         Saturday Morning



                                                   REVIEW
               One of VBA’s strengths is its powerful collection of string functions. It’s hard to imagine a
               text-handling task that VBA could not handle. Among the things you learned in this session
               are:
                   The MsgBox function displays a text message to the user.
                   The InputBox function accepts text input from the user.
                   You can search for text starting at either the start (InStr function) or the end
                   (InStrRev function) of the text.
                   String comparisons can be case-sensitive or case-insensitive.
                   Characters are represented by numbers, and the Asc and Chr functions let you con-
                   vert from one to the other.
                   The Left, Right, and Mid functions are used to extract parts of strings.



                                               QUIZ YOURSELF
                 1. What does the MsgBox function’s return value tell you? (See the “The MsgBox
                    Function” section.)
                 2. How do the Mid function and the Mid statement differ? (See the “The Mid
                    Function” and “The Mid Statement” sections.)
                 3. In VBA, is the string “apple” always considered equal to the string “APPLE”? Please
                    explain. (See the “Comparing Strings” section.)
                 4. How do the Asc and AscW functions differ? (See the “The Asc, AscB, and AscW
                    Functions” section.”)
                 5. What functions are used to trim leading and trailing spaces from strings? (See the
                    “Extracting or Modifying Parts of Strings” section.)
   140   141   142   143   144   145   146   147   148   149   150