Excel Reference

Chart object events

Direct Answer

Chart object events
is part of the Excel VBA object model. This reference page documents its syntax, parameters, and typical usage.

Reference

Chart events occur when the user activates or changes a chart. Events on chart sheets are enabled by default. To view the event procedures for a sheet, right-click the sheet tab and select View Code from the shortcut menu. Select the event name from the Procedure drop-down list box.

  • Activate.md)
  • BeforeDoubleClick
  • BeforeRightClick
  • Calculate
  • Deactivate
  • MouseDown
  • MouseMove
  • MouseUp
  • Resize
  • Select.md)
  • SeriesChange

> NOTE:
> To write event procedures for an embedded chart, you must create a new object using the WithEvents keyword in a class module. For more information, see Using events with embedded charts.

This example changes a point’s border color when the user changes the point value.

vb
Private Sub Chart_SeriesChange(ByVal SeriesIndex As Long, _
ByVal PointIndex As Long)
Set p = ActiveChart.SeriesCollection(SeriesIndex). _
Points(PointIndex)
p.Border.ColorIndex = 3
End Sub

See also

!include[Support and feedback]

Reference: Excel object-model documentation • updated 11/13/2018
. Rebuilt for readability; see the original for complete parameter matrices.