Axes object (Excel)

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

Remarks

Use the Axes method of the Chart object to return the Axes collection.

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

  • Type can be one of the following XlAxisType constants: xlCategory, xlSeriesAxis, or xlValue.

  • Group can be one of the following XlAxisGroup constants: xlPrimary or xlSecondary.

Example

The following example displays the number of axes on embedded chart one on worksheet one.

With Worksheets(1).ChartObjects(1).Chart 
 MsgBox.Axes.Count 
End With

The following example sets the category axis title text on the chart sheet named Chart1.

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

Methods

Properties

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.