SheetActivate Event

Microsoft Office Web Components Visual Basic

Private Sub Object_SheetActivate(ByVal Sh As 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