constant that represents the type of object currently selected in the chart workspace. Read-only.
ChartSelectionsEnum can be one of these ChartSelectionsEnum constants. |
chSelectionAxis |
chSelectionCategoryLabel |
chSelectionChart |
chSelectionChartSpace |
chSelectionDataLabel |
chSelectionDataLabels |
chSelectionDropZone |
chSelectionErrorbars |
chSelectionField |
chSelectionGridlines |
chSelectionLegend |
chSelectionLegendEntry |
chSelectionNone |
chSelectionPlotArea |
chSelectionPoint |
chSelectionSeries |
chSelectionSurface |
chSelectionTitle |
chSelectionTrendline |
chSelectionUserDefined |
PivotTable object: Returns a String that represents the type of object currently selected in the PivotTable list. Read-only.
expression.SelectionType
expression Required. An expression that returns a ChartSpace or PivotTable object.
Example
The procedure in this example runs whenever the selection in the chart workspace changes. If the user selects an axis, the procedure displays the minimum and maximum values for the axis.
Sub ChartSpace1_SelectionChange()
Dim chConstants
Dim minval
Dim maxval
Set chConstants = ChartSpace1.Constants
If ChartSpace1.SelectionType = chConstants.chSelectionAxis Then
minval = ChartSpace1.Selection.Scaling.Minimum
maxval = ChartSpace1.Selection.Scaling.Maximum
MsgBox "minimum = " & minval & " maximum = " & maxval
End If
End Sub