After you select View Code
, you are taken directly into the VBE (Visual Basic Editor) where you can start entering the event procedure code:
Chart_Activate
Syntax: Chart_Activate()
The Chart_Activate
event procedure runs when a chart sheet is activated or changed.
Chart Activate
Event Example:
Private Sub Chart_Activate() MsgBox "The chart is activated" End Sub
Chart_Deactivate
Syntax: Chart_Deactivate()
The Chart_Deactivate
event procedure runs when a chart sheet is deactivated. For example when you open another sheet.
Chart Deactivate
Event Example:
Private Sub Chart_Deactivate() MsgBox "Chart Deactivated" End Sub
Chart_Calculate
Syntax: Chart_Calculate()
The Chart_Calculate
event procedure runs when a new or changed data is plotted on a chart.
Chart Calculate
Event Example:
Private Sub Chart_Calculate() MsgBox "Chart re-calculated" End Sub
Chart_Resize
Syntax: Chart_Resize()
The Chart_Resize
event procedure runs when you resize a chart using the resize handles.
Chart Resize Event Example:
Private Sub Chart_Resize() MsgBox "Chart resized" End Sub
Chart_SeriesChange
Syntax: Chart_SeriesChange(SeriesIndex, PointIndex)
Note: This event does not work in Excel 2007 and later.
The Chart_SeriesChange
event procedure runs when a chart data point is changed. This procedure has two arguments:
SeriesIndex
The offset in the Series collection of updated seriesPointIndex
The offset in the Point collection of updated points
Chart SeriesChange Event Example:
Private Sub Chart_SeriesChange(ByVal SeriesIndex As Long, ByVal PointIndex As Long) 'Not works in Excel 2007 and later. End Sub