Class Axis (Excel VBA)

The class Axis represents a single axis in a chart.

The main procedures of class Axis are Delete and Select

Set

To use a Axis class variable it first needs to be instantiated, for example

Dim axi as Axis
Set axi = ActiveChart.Axes(Type:=1)

The following procedures can be used to set variables of type Axis: Chart.Axes and Axes.Item

For Each

Here is an example of processing the Axis items in a collection.

Dim axiAxe As Axis
For Each axiAxe In ActiveChart.Axes()
	
Next axiAxe

Themes

The following procedures in this class have been grouped together and are described on a separate theme page

Name with its procedures AxisTitle, CategoryNames and HasTitle

Methods

These are the main methods of the Axis class

Delete - Deletes the object.

ActiveChart.Axes(1).Delete

Select - Selects the object.

ActiveChart.Axes(1).Select

Other Methods

Axes.Item - Returns a single Axis object from an Axes collection.

Properties

Axes.Count returns a Long value that represents the number of objects in the collection.

Axes.Parent returns the parent object for the specified object. Read-only.

AxisBetweenCategories true if the value axis crosses the category axis between categories.

AxisGroup returns the group for the specified axis.

BaseUnit returns or sets the base unit for the specified category axis.

BaseUnitIsAuto true if Microsoft Excel chooses appropriate base units for the specified category axis. The default value is True.

Border returns a Border object that represents the border of the object.

CategorySortOrder

CategoryType returns or sets the category axis type.

Crosses returns or sets the point on the specified axis where the other axis crosses.

CrossesAt returns or sets the point on the value axis where the category axis crosses it. Applies only to the value axis.

DisplayUnit returns or sets the unit label for the value axis.

DisplayUnitCustom if the value of the DisplayUnit property is xlCustom, the DisplayUnitCustom property returns or sets the value of the displayed units. The value must be from 0 through 10E307.

DisplayUnitLabel returns the DisplayUnitLabel object for the specified axis. Returns null if the HasDisplayUnitLabel property is set to False.

Format returns the ChartFormat object.

HasDisplayUnitLabel true if the label specified by the DisplayUnit or DisplayUnitCustom property is displayed on the specified axis. The default value is True.

HasMajorGridlines true if the axis has major gridlines. Only axes in the primary axis group can have gridlines.

HasMinorGridlines true if the axis has minor gridlines. Only axes in the primary axis group can have gridlines.

Height returns a Double value that represents the height, in points, of the object.

Left returns a Double value that represents the distance, in points, from the left edge of the object to the left edge of the chart area.

LogBase returns or sets the base of the logarithm when you are using log scales.

MajorGridlines returns a Gridlines object that represents the major gridlines for the specified axis. Only axes in the primary axis group can have gridlines.

MajorTickMark returns or sets the type of major tick mark for the specified axis.

MajorUnit returns or sets the major units for the value axis.

MajorUnitIsAuto true if Microsoft Excel calculates the major units for the value axis.

MajorUnitScale returns or sets the major unit scale value for the category axis when the CategoryType property is set to xlTimeScale.

MaximumScale returns or sets the maximum value on the value axis.

MaximumScaleIsAuto true if Microsoft Excel calculates the maximum value for the value axis.

MinimumScale returns or sets the minimum value on the value axis.

MinimumScaleIsAuto true if Microsoft Excel calculates the minimum value for the value axis.

MinorGridlines returns a Gridlines object that represents the minor gridlines for the specified axis. Only axes in the primary axis group can have gridlines.

MinorTickMark returns or sets the type of minor tick mark for the specified axis.

MinorUnit returns or sets the minor units on the value axis.

MinorUnitIsAuto true if Microsoft Excel calculates minor units for the value axis.

MinorUnitScale returns or sets the minor unit scale value for the category axis when the CategoryType property is set to xlTimeScale.

Parent returns the parent object for the specified object. Read-only.

ReversePlotOrder true if Microsoft Excel plots data points from last to first.

ScaleType returns or sets the value axis scale type.

TickLabelPosition describes the position of tick-mark labels on the specified axis.

TickLabels returns a TickLabels object that represents the tick-mark labels for the specified axis.

TickLabelSpacing returns or sets the number of categories or series between tick-mark labels. Applies only to category and series axes. Can be a value from 1 through 31999.

TickLabelSpacingIsAuto returns or sets whether or not the tick label spacing is automatic.

TickMarkSpacing returns or sets the number of categories or series between tick marks. Applies only to category and series axes. Can be a value from 1 through 31999.

Top returns a Double value that represents the distance, in points, from the top edge of the object to the top of row 1 (on a worksheet) or the top of the chart area (on a chart).

Type returns an XlAxisType value that represents the Axis type.

Width returns a Double value that represents the width, in points, of the object.