Chapter 11 Automatic Procedures and OnEvent Procedures
An event in Microsoft Excel is the occurrence of an action such as opening a workbook, switching to a sheet, using a particular key combination, or recalculating a worksheet. Some events are initiated by the user; others are initiated by Microsoft Excel or by other applications. By assigning procedures to events, you can enhance or alter the way users interact with your application.
There are three main classes of event-driven procedures, organized by the way you associate the procedure with the event:
- You can associate a procedure with the action of clicking a button or other object; you do this by using the Assign Macro command on the Tools menu, as discussed in the preceding chapters.
- You can associate a procedure with one of a specfic set of workbook-level and worksheet-level events by giving the procedure a special automatic procedure name that begins with "Auto_".
- You can associate a procedure with a defined event for an object by setting an OnEvent property of the object (such as the OnWindow or OnCalculate property) to the procedure name.
Contents
- Creating Automatic Procedures
- Creating OnEvent Procedures