Page 49 - Excel Progamming Weekend Crash Course
P. 49

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




                24                                                            Friday Evening


               Table 2-1      Selected VBA Editor Menu Commands

               Menu             Command                 Action
               File             Save                    Saves the current project (workbook)
               File             Close and Return . . .  Closes the Editor and returns to Excel
               File             Remove . . .            Removes the specified object from the
                                                        project
               Edit             Undo                    Reverses the most recent editing action
               Edit             Redo                    Reverses the most recent Undo action

               View             Microsoft Excel         Displays Excel without closing the Editor
               View             Toolbars                Enables you to display, hide, or customize
                                                        toolbars

               Insert           Procedure               Inserts a procedure into the current module
               Insert           UserForm                Inserts a new user form into the current
                                                        project
               Insert           Module                  Inserts a new module into the current
                                                        project

               Insert           Class Module            Inserts a new class module into the current
                                                        project

               Tools            Options                 Enables you to set VBA Editor options
               Tools            . . . Properties        Enables you to set project properties



                          The Editor provides toolbar buttons and keyboard shortcuts for many menu
                          commands.
                   Tip


               Using Macros in Programming

               As mentioned in Session 1, a macro is a form of programming. A macro is a record of actions
               carried out in Excel and can include any action that the user might take — entering data,
               selecting menu commands, creating charts, printing, and so on. While a macro is being
               recorded, the user actions are translated into VBA code. After the macro has been recorded,
               it can be played back whenever needed to recreate the same actions.
                  Strictly speaking, recording a macro is not programming because you are simply record-
               ing actions and not actually writing a program from scratch. Even so, macro recording can
               be useful to the VBA programmer in two ways:
   44   45   46   47   48   49   50   51   52   53   54