Syntax

expression.Axes(Type, AxisGroup)

expression A variable that represents a Chart object.

Parameters

Name Required/Optional Data Type Description
Type Optional Variant Specifies the axis to return. Can be one of the following constants: xlValue, xlCategory, or xlSeriesAxis (xlSeriesAxis is valid only for 3-D charts).
AxisGroup Optional Specifies the axis group. If this argument is omitted, the primary group is used. 3-D charts have only one axis group.

Return Value
Object

Example

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

Visual Basic for Applications
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.

Visual Basic for Applications
Charts("Chart1").Axes(xlCategory).HasMajorGridlines = False

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

Visual Basic for Applications
For Each a In Charts("Chart1").Axes a.HasMajorGridlines = False a.HasMinorGridlines = False Next a
axes Axes Method Change a specific chart axis? Loop through all axes on chart? Return an object that represents a single chart axis?

See also: