XL: Methods and Properties Used to Create OnEvent Procedures

Last reviewed: February 3, 1998
Article ID: Q151468
The information in this article applies to:
  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for Windows 95, version 7.0
  • Microsoft Excel for the Macintosh, versions 5.0, 5.0a

SUMMARY

The following article lists the Visual Basic for Applications Edition methods and properties that are used to create OnEvent procedures in Microsoft Excel.

MORE INFORMATION

Several objects in Microsoft Excel Visual Basic for Applications Edition have certain methods and properties which have an association with certain events. An example of this is clicking an object. Using Visual Basic for Applications, you can make a procedure run when these events occur. The following are the methods and properties, and the events that cause the associated procedures to run.

   Methods and Properties             Events That Cause Procedures to Run
   ----------------------             -----------------------------------

   OnAction Property:                 Clicking a control or a graphic
                                      object, clicking a menu command, or
                                      clicking a toolbar button

   OnCalculate Property:              Recalculating a worksheet

   OnData Property:                   The arrival of data from another
                                      application through OLE or DDE

   OnDoubleClick Property:            Double-clicking anywhere on a chart
                                      sheet, dialog sheet, module or
                                      worksheet

   OnEntry Property:                  Entering data using the formula bar
                                      or editing data in a cell

   OnKey Method:                      Pressing a particular key or key
                                      combination

   OnRepeat Method:                   Clicking Repeat on the Edit Menu

   OnSave Property (7.0 only):        Invoking the Save or Save As command

   OnSheetActivate Property:          Activating a chart sheet, dialog
                                      sheet, module sheet, worksheet,
                                      workbook, or Microsoft Excel itself

   OnSheetDeactivate Property:        Deactivating a chart sheet, dialog
                                      sheet, module, worksheet, workbook,
                                      or Microsoft Excel itself

   OnTime Method:                     Waiting until a specific time
                                      arrives, or waiting for a specified
                                      time delay

   OnUndo Method:                     Clicking Undo on the Edit Menu

   OnWindow Property:                 Activating a window


For additional information about events in Microsoft Excel 97 and Microsoft Excel 98, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q161761
   TITLE     : XL97: Summary of Workbook and Worksheet Application Events

REFERENCES

For more information about OnEvent methods and properties in Microsoft Excel version 7.0, click Answer Wizard on the Help menu and type:

   onevent

For more information about OnEvent methods and properties in Microsoft Excel version 5.0, click the Search button in Help and type:

   onevent


Additional query words: 5.0 5.0a 5.0c 7.0 7.0a vba
Keywords : kbprg PgmOthr
Version : WINDOWS: 5.0, 5.0c, 7.0; MACINTOSH: 5.0, 5.0a
Platform : MACINTOSH WINDOWS
Issue type : kbref


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 3, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.