WorksheetBase.SelectionChange Event


Occurs when the selection changes on a worksheet.

Namespace:   Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

public event DocEvents_SelectionChangeEventHandler SelectionChange

The following code example demonstrates a handler for the SelectionChange event that displays the sheet name and address of the selected range in the status bar.

This example is for a document-level customization.

private void WorksheetSelectionChange()
    this.SelectionChange += 
        new Excel.DocEvents_SelectionChangeEventHandler(

void Worksheet1_SelectionChange(Excel.Range Target)
    this.Application.StatusBar = this.Name + ":" +
Return to top