Page 46 - Excel Progamming Weekend Crash Course
P. 46

d540629 ch02.qxd  9/2/03  9:27 AM  Page 21




                  Session 2 — The VBA Code Editor                                         21


                   Auto Quick Info. When you enter the name of the VBA function, the Editor displays
                   information about the function and its parameters.
                   Auto Indent. This feature automatically indents each new line of VBA code to align
                   with the previous line. Use Tab to indent more or Shift+Tab to indent less.

                  These features are all optional, and can be turned on or off according to your personal
               preferences. To select which features are active:

                 1. Select Tools ➪ Options to display the Options dialog box.
                 2. Select the Editor tab (see Figure 2-3).





















                    Figure 2-3 Setting VBA Editor options
                 3. Put a check mark next to the options you want to use, and remove the check mark
                    from those you do not want to use.
                 4. Click OK.
                  Another useful feature of the Editor is its capability to display different types of text
               using different colors and/or fonts. For example, VBA keywords can be displayed in a differ-
               ent color than normal text, such as variable names. These options are set on the Editor
               Format tab of the Options dialog box.

                          VBA Code Editor options have no effect on how your code runs or how the
                          final program operates. They are for the programmer’s convenience only.
                  Note
                  You learned earlier in this session that procedures are a basic unit of VBA code organiza-
               tion. When an editing window contains two or more procedures, there are two ways they
               can be displayed:
                   Full module view. All procedures display at once (although you may need to scroll
                   down the window to view some of them) with a horizontal line between the end of
                   each procedure and the beginning of the next.
   41   42   43   44   45   46   47   48   49   50   51