Axes Method

Applies To

Chart Object.

Description

Accessor. Returns an object that represents a single axis (an Axis object, Syntax 1) or a collection of the axes on the chart (an Axes object, Syntax 2).

Syntax 1

object.Axes(type, axisGroup)

Syntax 2

object.Axes

object

Required. The Chart object.

type

Required for Syntax 1. Specifies the axis to return. Can be one of xlValue, xlCategory, or xlSeries (xlSeries is only valid for 3-D charts).

axisGroup

Optional. Specifies the axis group (either xlPrimary or xlSecondary). If this argument is omitted, the primary group is used. 3-D charts have only one axis group.

Example

This example adds an axis label to the category axis in Chart1.


With Charts("Chart1").Axes(xlCategory)
    .HasTitle = True
    .AxisTitle.Text = "July Sales"
End With

This example turns off major gridlines for the category axis in Chart1.


Charts("Chart1").Axes(xlCategory).HasMajorGridlines = False

This example turns off all gridlines for all axes in Chart1.


For Each a In Charts("Chart1").Axes
    a.HasMajorGridlines = False
    a.HasMinorGridlines = False
Next a