title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
Workbook.SheetSelectionChange event (Excel) |
vbaxl10.chm503085 |
|
|
a3829af1-2917-9526-1d64-91eeb6c198ce |
05/29/2019 |
medium |
Occurs when the selection changes on any worksheet (doesn't occur if the selection is on a chart sheet).
expression.SheetSelectionChange (Sh, Target)
expression An expression that returns a Workbook object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
Sh | Required | Object | The worksheet that contains the new selection. |
Target | Required | Range | The new selected range. |
This example displays the sheet name and address of the selected range in the status bar.
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
Application.StatusBar = Sh.Name & ":" & Target.Address
End Sub
[!includeSupport and feedback]