Name
chart
.Axes([Type], [AxisGroup])
Synopsis
Returns one or all of the axes on a chart.
Argument |
Settings |
---|---|
|
For 2-D charts, |
|
For 2-D charts, |
The following code applies labels to identify the x-, y-, and z-axes of a 3-D chart:
Sub LabelAxes( ) Dim chrt As Chart, ax As Axis Set chrt = Charts("Demo Chart Types") ' Activate the chart sheet. chrt.Activate ' Change chart type to 3-D. chrt.ApplyCustomType xl3DLine ' Get the category axis. Set ax = chrt.Axes(xlCategory) ' Add a title. ax.HasTitle = True ' Set the title. ax.AxisTitle.Caption = "Category" ' Repeat for value axis. Set ax = chrt.Axes(xlValue) ax.HasTitle = True ax.AxisTitle.Caption = "Value" ' Repeat for series axis. Set ax = chrt.Axes(xlSeries, xlPrimary) ax.HasTitle = True ax.AxisTitle.Caption = "Series" End Sub
Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.