Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 1.12 KB

Excel.Workbook.SheetSelectionChange.md

File metadata and controls

46 lines (30 loc) · 1.12 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Workbook.SheetSelectionChange event (Excel)
vbaxl10.chm503085
vbaxl10.chm503085
Excel.Workbook.SheetSelectionChange
a3829af1-2917-9526-1d64-91eeb6c198ce
05/29/2019
medium

Workbook.SheetSelectionChange event (Excel)

Occurs when the selection changes on any worksheet (doesn't occur if the selection is on a chart sheet).

Syntax

expression.SheetSelectionChange (Sh, Target)

expression An expression that returns a Workbook object.

Parameters

Name Required/Optional Data type Description
Sh Required Object The worksheet that contains the new selection.
Target Required Range The new selected range.

Example

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]