SheetActivate Event

Microsoft Excel Visual Basic

Occurs when any sheet is activated.

Private Sub object_SheetActivate(ByVal Sh As Object)

object    Application or Workbook.

Sh    The activated sheet. Can be a Chart or Worksheet object.

Example

This example displays the name of each activated sheet.

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    MsgBox Sh.Name
End Sub