Chart Select Event



Syntax
Private Sub Chart_Select(ByVal ElementID As Long, ByVal Arg1 As Long, ByVal Arg2 As Long)
Enter Code
End Sub

This event will run code when a chart element is selected.

Required Parameters
ElementID
The selected chart element. The value of this parameter determines the expected values of Arg1 and Arg2. For more information about this parameter, see the Chart Arguments.

Arg1
Additional event information, depending on the value of ElementID. For more information about this parameter, see the Chart Arguments.

Arg2
Additional event information, depending on the value of ElementID. For more information about this parameter, see the Chart Arguments.

Example
Private Sub Chart_Select(ByVal ElementID As Long, _
 ByVal Arg1 As Long, ByVal Arg2 As Long)
 If ElementId = xlChartTitle Then
 MsgBox "please don't change the chart title"
 End If
End Sub

Result
This example displays a message box if the user selects the chart title.