Share via


Axes Collection

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Axes
Aa189448.space(en-us,office.10).gifAa189448.parchild(en-us,office.10).gifAxis
Aa189448.space(en-us,office.10).gifAa189448.space(en-us,office.10).gifAa189448.parchild(en-us,office.10).gif

A collection of all the Axis objects in the specified chart.

Using the Axes Collection

Use the Axes method to return the Axes collection. The following example displays the number of axes in the chart.

  With myChart
    MsgBox .Axes.Count
End With

Use Axes(type, group), where type is the axis type and group is the axis group, to return a single Axis object.

XlAxisType

XlAxisType can be one of these XlAxisType constants.
xlCategory
xlSeries

xlValue

Group can be either of the following XlAxisGroup constants: xlPrimary or xlSecondary. For more information, see the Axes method.

The following example sets the title text for the category axis.

  With myChart.Axes(xlCategory)
    .HasTitle = True
    .AxisTitle.Caption = "1994"
End With