Show AllShow All

Axes Method

Returns an object that represents either a single axis or a collection of the axes on the chart.

expression.Axes(Type, AxisGroup)

expression    Required. An expression that returns one of the objects in the Applies To list.

Type    Optional XlAxisType. Specifies the axis to return. The reference style of the formula.

AxisGroup    Optional XlAxisGroup. The reference style of the formula.

Example

This example adds an axis label to the category axis.

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

This example turns off major gridlines for the category axis.

myChart.Axes(xlCategory).HasMajorGridlines = False
		

This example turns off all gridlines for all axes.

For Each a In myChart.Axes
    a.HasMajorGridlines = False
    a.HasMinorGridlines = False
Next a