Summary of workbook and worksheet application events

Article translations Article translations
Article ID: 291294 - View products that this article applies to.
This article was previously published under Q291294
For a Microsoft Microsoft Excel 2000 version of this article, see 213220.
For a Microsoft Microsoft Excel 97 version of this article, see 161761.
Expand all | Collapse all

On This Page

SUMMARY

This article includes a summary of Visual Basic for Applications workbook and worksheet events and of the corresponding commands that are used in versions of Microsoft Excel that are earlier than Microsoft Excel 97.

MORE INFORMATION

Workbook events

                      Previous version
   Event name         equivalent         When the event occurs
   -----------------  -----------------  --------------------------------

   Activate           Auto_Activate      When the active workbook changes
                                         from another workbook to this
                                         workbook

   Deactivate         Auto_Deactivate    When the active workbook changes
                                         from this workbook to another
                                         workbook

   Open               Auto_Open          When the workbook opens

   BeforeClose        Auto_Close         Before the workbook closes

   AddInInstall       Auto_Add           When the user installs the add-in
                                         through the add-in manager
  
   AddInUninstall     Auto_Remove        When the user uninstalls the
                                         add-in through the add-in manager

   WindowResize       Not applicable     After a window of the workbook has
                                         been opened, resized, maximized,
                                         or minimized

   WindowActivate     OnWindow           Every time the focus comes to a
                                         window belonging to the workbook

   WindowDeactivate   OnWindow           Every time the focus leaves this
                                         particular window of the workbook

   BeforeSave         OnSave             Before a workbook saves

   BeforePrint        Not applicable     Before a workbook prints

   NewSheet           Not applicable     After a new sheet is created

   SheetActivate      OnSheetActivate    Every time a sheet is activated in
                                         the workbook

   SheetDeactivate    OnSheetDeactivate  After a sheet is deactivated in
                                         the workbook

   SheetCalculate     OnCalculate        After any recalculation in the
                                         workbook

   SheetBefore        OnDoubleClick      When a worksheet cell is double-
   DoubleClick                           clicked

   SheetSelection     Not applicable     When there is any change in cell
   Change                                selection on a particular sheet

   SheetBefore        Not applicable     When a worksheet cell is right-
   RightClick                            clicked

   SheetChange        OnEntry            When a user changes the formula
                                         of a cell by typing, copy or
                                         paste, drag or drop, or undo

   PivotTableClose    Not applicable     After a PivotTable closes the
   Connection                            connection to its data source
  
   PivotTableOpen     Not applicable     After a PivotTable opens the
   Connection                            connection to its data source
  
   SheetFollow        Not applicable     When you click any hyperlink
   Hyperlink
  
   SheetPivotTable    Not applicable     After the sheet of the
   Update                                PivotTable report has been
                                         updated
				

Worksheet events

                      Previous version
   Event name         equivalent         When the event occurs
   -----------------  -----------------  -------------------------------

   Activate           OnSheetActivate    When the active sheet changes
                                         from another sheet to this sheet

   Deactivate         OnSheetDeactivate  After the active sheet changes
                                         from this sheet to another sheet
                                         Fires before the activated sheet
                                         displays.

   Calculate          OnCalculate        After every recalculation of this
                                         sheet

   BeforeDoubleClick  OnDoubleClick      When a worksheet cell is double-
                                         clicked

   SelectionChange    Not applicable     When a worksheet cell is clicked

   BeforeRightClick   Not applicable     When a worksheet cell is
                                         right-clicked

   Change             OnEntry            When a user changes the formula
                                         of a cell by typing, copy or
                                         paste, drag or drop, or undo

   FollowHyperlink    Not applicable     When a user clicks on any
                                         hyperlink in the worksheet

   PivotTableUpdate   Not applicable     After a PivotTable report is
                                         updated on a worksheet
				

Additional events for Microsoft Office Excel 2003

Collapse this tableExpand this table
Event nameWhen the event occurs
SyncWhen the local copy of a worksheet that is part of a Document Workspace is synchronized with the copy on the server
AfterXmlExportAfter Excel saves or exports data from the specified workbook to an XML data file
AfterXmlImportAfter an existing XML data connection is refreshed, or after new XML data is imported into the specified Excel workbook
BeforeXmlExportBefore Excel saves or exports data from the specified workbook to an XML data file
Collapse this tableExpand this table
BeforeXmlImportBefore an existing XML data connection is refreshed, or before new XML data is imported into a Excel workbook

Additional event for Microsoft Office Excel 2007

Collapse this tableExpand this table
Event nameWhen the event occurs
Collapse this tableExpand this table
Workbook_RowsetCompleteWhen the user drills through the recordset, or when the user invokes the rowset action on an Online Analytical Processing (OLAP) PivotTable

Properties

Article ID: 291294 - Last Review: March 23, 2007 - Revision: 3.0
APPLIES TO
  • Microsoft Office Excel 2007
  • Microsoft Office Excel 2003
  • Microsoft Excel 2002 Standard Edition
Keywords: 
kbhowto KB291294

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com