SelectionChange Event

Microsoft Office Web Components Visual Basic

Private Sub Object_SelectionChange( )

Object    The name of the ChartSpace , PivotTable , or Spreadsheet object that this event applies to.

Remarks

For information about using events with VBScript, see Declaring and Using Event Procedures in VBScript .

You can use the Selection property to determine the object type of the current selection, as shown in the following example.

Private Sub PivotTable_SelectionChange()
    If TypeName(PivotTable.Selection) = "PivotTotal" Then
        'Handle selection of a total here
    End If
End Sub