CategoryNames Property

Applies To

Axis object.

Description

Returns or sets all the category names for the specified axis, as a text array. When you set this property, you can set it to either an array or a Range object that contains the category names. Read/write Variant.

Remarks

Category names are really a property of the "special" series in an axis grouping. Deleting or modifying that special series will change the category names for all series using the axis.

See Also

Formula property, Values property, XValues property.

Example

This example sets the category names for Chart1 to the values in cells B1:B5 on Sheet1.

Set Charts("Chart1").Axes(xlCategory).CategoryNames = _
    Worksheets("Sheet1").Range("B1:B5")
This example uses an array to set individual category names for Chart1.

Charts("Chart1").Axes(xlCategory).CategoryNames = _
    Array ("1985", "1986", "1987", "1988", "1989")