Bewerken

Delen via


Font.ColorIndex property (Excel)

Returns or sets a Variant value that represents the color of the font.

Syntax

expression.ColorIndex

expression A variable that represents a Font object.

Remarks

The color is specified as an index value into the current color palette, or as one of the following XlColorIndex constants: xlColorIndexAutomatic or xlColorIndexNone.

Example

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

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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.