Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ColorIndex Property [Excel 2003 VBA Language Reference]

Office 2003

XlColorIndex can be one of these XlColorIndex constants.
xlColorIndexAutomatic
xlColorIndexNone

expression.ColorIndex

expression Required. An expression that returns an object in the Applies To List.

XlColorIndex can be one of these XlColorIndex constants.
xlColorIndexAutomatic
xlColorIndexNone

expression.ColorIndex

expression Required. An expression that returns an object in the Applies To List.

XlColorIndex can be one of these XlColorIndex constants.
xlColorIndexAutomatic. Use to specify automatic color.
xlColorIndexNone.  

expression.ColorIndex

expression Required. An expression that returns an object in the Applies To List.

XlColorIndex can be one of these XlColorIndex constants.
xlColorIndexAutomatic. Use to specify the automatic fill, for drawing objects.
xlColorIndexNone. Use to specify no interior fill.

expression.ColorIndex

expression Required. An expression that returns an object in the Applies To List.

XlColorIndex can be one of these XlColorIndex constants.
xlColorIndexNone. Use to specify that the tab has no color.

expression.ColorIndex

expression Required. An expression that returns an object in the Applies To List.

Example

The following examples assume that you're using the default color palette.

This example sets the color of the major gridlines for the value axis in Chart1.

With Charts("Chart1").Axes(xlValue)
    If .HasMajorGridlines Then
        .MajorGridlines.Border.ColorIndex = 5    'set color to blue
    End If
End With
				

This example changes the font color in cell A1 on Sheet1 to red.

Worksheets("Sheet1").Range("A1").Font.ColorIndex = 3
				

This example sets the color of the chart area interior of Chart1 to red and sets the border color to blue.

With Charts("Chart1").ChartArea
    .Interior.ColorIndex = 3
    .Border.ColorIndex = 5
End With
				




Show:
© 2015 Microsoft