Key Points


  • Watch what a macro is doing by reducing the Visual Basic editor window while stepping through the macro.

  • Record macros in small pieces. You can always move statements from one macro to another, or run the separate macros as subroutines.

  • After recording a macro, watch for ways to generalize it for future use. The CurrentRegion method is a great way to refer to a range that may be a different size each time you run the macro.

  • Use GetOpenFilename to prompt for a file name or the InputBox function to get information while running the macro.

  • Use variables to store a string or other value so that you can use it later in the macro.

  • Switch the recorder to relative mode to record relative movements rather than absolute addresses. This is particularly useful when appending to the bottom of a list.



Microsoft Office Excel 2007 Visual Basic for Applications Step by Step
Microsoft Excel 2002 Visual Basic for Applications Step by Step (Step by Step (Microsoft))
ISBN: 0735613591
EAN: 2147483647
Year: 2004
Pages: 99
Authors: Reed Jacobsen

Similar book on Amazon
Excel 2003 Power Programming with VBA (Book & CD-ROM)
Excel 2003 Power Programming with VBA (Book & CD-ROM)
Microsoftu00ae Office Excelu00ae 2007 Visual Basicu00ae for Applications Step by Step (BPG-step by Step)
Microsoftu00ae Office Excelu00ae 2007 Visual Basicu00ae for Applications Step by Step (BPG-step by Step)
Excel 2003 Formulas
Excel 2003 Formulas
Writing Excel Macros with VBA, 2nd Edition
Writing Excel Macros with VBA, 2nd Edition

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net