Chapter 17. Automating Procedures with Excel Events

Understanding Excel Events

An event occurs in Excel whenever the user performs any type of action. For example, an event occurs when the user closes a workbook. You can use events to trigger the execution of procedures by creating event procedures. Event procedures are exactly what the name describes: procedures that execute when a particular event occurs.

To trap or capture an event with an event procedure, you must place the procedure code in the correct type of module. For example, workbook-related events must be in the ThisWorkbook object standard module.

There are several categories of events. Each event category has a set of events associated with it. For example, the BeforeClose event is ...

Get Excel® Programming: Your visual blueprint™ for creating interactive spreadsheets now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.