SheetDeactivate Event

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Occurs when a worksheet is deactivated.

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