Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Worksheet Events.
by Allen Wyatt
(last updated January 19, 2017)
One of the beauties of creating macros for Excel is that they can be event-driven. This means that you can create macros that will run automatically when specific, well-defined events happen within Excel. These events can happen either on a worksheet or a workbook level.
The easiest way to see what worksheet events are available is to follow these steps:
At this point, the right-hand drop-down list contains all the events that you can "trap" for this worksheet. The available events may vary, according to your version of Excel. In Excel 2003 the following events are available:
The names of the events should be descriptive enough that you can tell what triggers each of them. If you choose one of the events, you can create the macro you want run when the event actually occurs.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2569) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Worksheet Events.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
Troubleshooting an Excel macro when it causes the entire computer to freeze can be a tedious affair. This tip provides ...Discover More
If you are using a macro to process a number of worksheets, you may have a need to know if the worksheet is empty or not. ...Discover More
Excel is great for collecting all sorts of information. You might even use it to create a catalog of your photos. Working ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.