Worksheet Events

The events for a Worksheet object are some of the most useful. As you can see, monitoring these events can make your applications perform feats that would otherwise be impossible.

Table 19-2 lists the worksheet events, with a brief description of each.

TABLE 19-2 WORKSHEET EVENTS

Event

Action That Triggers the Event

Activate

The worksheet is activated.

BeforeDoubleClick

The worksheet is double-clicked.

BeforeRightClick

The worksheet is right-clicked.

Calculate

The worksheet is calculated (or recalculated).

Change

Cells on the worksheet are changed by the user or by an

external link.

Deactivate

The worksheet is deactivated.

FollowHyperlink

A hyperlink on the sheet is clicked.

PivotTableUpdate*

A pivot table on the sheet is updated.

SelectionChange

The selection on the worksheet is changed.

*This event was added in Excel 2002 and is not supported in previous versions.

*This event was added in Excel 2002 and is not supported in previous versions.

Remember that the code for a worksheet event must be stored in the code module for the specific worksheet.

To quickly activate the code module for a worksheet, right-click the sheet tab and then choose View Code.

0 0

Post a comment