Share via


SheetActivate Event

Occurs when a worksheet is activated.

Private Sub Object_SheetActivate(ByValShAs Worksheet)

Object The name of the Spreadsheet object that you are trapping this event for.

Sh    Required Worksheet. The worksheet that has been activated.

Remarks

When a user changes worksheets, the SheetDeactivate event is called before the SheetActivate event.

Example

This example displays the name of the activated worksheet each time that a worksheet is activated in Spreadsheet1.

Sub Spreadsheet1_SheetActivate(Sh)

   MsgBox Sh.Name

End Sub

Applies to | Spreadsheet Object