SheetDeactivate Event

Microsoft Office Web Components Object Model

SheetDeactivate Event

       

Occurs when a worksheet is deactivated.

Private Sub Object _SheetDeactivate(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 deactivated.

Remarks

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

Example

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

Sub Spreadsheet1_SheetDeactivate(Sh)

   MsgBox Sh.Name & " was just deactivated."

End Sub