Skip to content

Latest commit

 

History

History
66 lines (43 loc) · 1.59 KB

Excel.Chart.Axes.md

File metadata and controls

66 lines (43 loc) · 1.59 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Chart.Axes method (Excel)
vbaxl10.chm149081
vbaxl10.chm149081
Excel.Chart.Axes
d0520f61-9aff-894b-9975-37dcb5b5fe3c
04/16/2019
medium

Chart.Axes method (Excel)

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

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 XlAxisType constants: xlValue, xlCategory, or xlSeriesAxis (xlSeriesAxis is valid only for 3D charts).
AxisGroup Optional XlAxisGroup Specifies the axis group. If this argument is omitted, the primary group is used. 3D charts have only one axis group.

Return value

Object

Example

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

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

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

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

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

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

[!includeSupport and feedback]