Accessing an Event Procedure

By now you are probably wondering how to write an event procedure. The short answer is that for each event, Excel provides us with an event code shell where we can place the event code for that event.

To illustrate, consider the SelectionChange event of the Worksheet object. Figure 11-1 shows the code window for a worksheet (Sheet1). Note that the Worksheet object is selected in the objects list box. This causes the procedures list box to be filled with the names of the worksheet events. We can simply choose the event for which we want to write event code.

0 0

Post a comment