Page 36 - Excel for Scientists and Engineers: Numerical Methods
P. 36

CHAPTER 1  INTRODUCING VISUAL BASIC FOR APPLICATIONS                  13



               Some FAQs
                   Here are answers to some Frequently Asked Questions about macros.
                I  Recorded  a  Command  Macro.  Where  Did  It  Go?  If  you  have
               trouble locating the code module containing your macro, here's what to do "when
                all  else  fails":  choose  Macro  from  the  Tools menu  and  Macros ... from  the
                submenu.  Highlight  the  name  of the  macro  in  the Macro Name  list  box,  and
                press the Edit button.  This will  display the code module sheet containing the
                Visual Basic code.
                I  Can't  Find  My  Function  Macro.  Where  Did  It  Go?  If  you're
                looking  in the  list  of  macros  in the Macro Name  list box, you  won't  find  it
                there.  Only  command  macros  (macros that  can  be Run)  are  listed.  Function
                macros are found in a different place: in the list of user-defined functions in the
                Insert  Function  dialog  box.  (Choose Function ... from  the  Insert  menu  and
                scroll through the Function Category list and select the User Defined category.)

                How  Do  I  Rename  a  Macro?  To rename a  Sub or  Function procedure,
                access the Visual Basic Editor and click on the module containing the procedure.
                The name of the macro is in the first line of code, immediately following the Sub
                or Function keyword.  Simply edit the name.  Again, no spaces are allowed in the
                name.
                How Do I Rename a Module Sheet?  You use the Properties window to
                change  the  name  of  a  module.  The  module  sheet  whose  name  you  want  to
                change must be the active sheet.  If the Properties window is not visible, choose
                Properties Window  from the View  menu,  or click on the Properties  Window
                              to  display  it.  The  Properties  Window  toolbutton  is the  fourth
                button from the right in the VBA toolbar.

















                    Figure 1-19.  Changing the name of a module by using the Properties window.
   31   32   33   34   35   36   37   38   39   40   41