Key Points


  • To create a new function that you can call from a worksheet, just change the word Sub to Function. You can also add arguments, the same as regular worksheet functions.

  • Use the statement Application.DisplayAlerts = False to tell Excel not to display a warning message-for example, when deleting a worksheet.

  • To simply ignore a possible error in one or two statements-for example, when deleting a file or worksheet-put the statements into a subroutine and add the statement On Error Resume Next at the top of the subroutine.

  • Use the Err object-particularly the Number and Description properties-to find out information about an error that occurred in a macro statement.

  • Use On Error GoTo along with the name of a label to force any errors to jump to a single error handler that begins with the specified label.



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