Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

SelectionChange Event [Excel 2003 VBA Language Reference]

Office 2003

Occurs when the selection changes on a worksheet.

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

Target The new selected range.

Example

This example scrolls through the workbook window until the selection is in the upper-left corner of the window.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    With ActiveWindow
        .ScrollRow = Target.Row
        .ScrollColumn = Target.Column
    End With
End Sub
		


Applies to | Worksheet Object


Show: