Page 72 - Excel Progamming Weekend Crash Course
P. 72

d540629 ch04.qxd  9/2/03  9:28 AM  Page 47


                                                                          SESSION



                                                                                 4










                                             Syntax and Data in VBA










               Session Checklist

               ✔ The basics of VBA syntax
               ✔ How to use constants
               ✔ How to declare program variables
               ✔ The different variable types available for number, text,
                  and other types of data
               ✔ Early versus late binding

               ✔ Using static and dynamic arrays
               ✔ Defining user-defined types and enumeration
               ✔ Understanding variable scope



                    very Excel program works with data of one kind or another, and the VBA language pro-
                    vides a powerful set of tools for maintaining data. This session explains how to main-
               E tain different types of data in your VBA programs, specifically how to store data in the
               program while it is running. First, however, you need to understand the fundamentals of
               VBA syntax.


               VBA Syntax Fundamentals

               Syntax in a programming language is similar in concept to syntax in the English (or any
               other) language. It provides rules as to how the language elements are to be used and orga-
               nized. Ending sentences with a period is an example of an English syntax rule. Before you
               start writing your own VBA code, you need to understand these fundamentals.
   67   68   69   70   71   72   73   74   75   76   77