PatternColorIndex Property

Applies To

Interior object.

Description

Returns or sets the color of the interior pattern as an index into the current color palette, or as one of the following XlColorIndex constants: xlColorIndexAutomatic or xlColorIndexNone. Read/write Long.

Remarks

Set this property to xlColorIndexAutomatic to specify the automatic pattern for cells or the automatic fill style for drawing objects. Set this property to xlColorIndexNone to specify that you don't want a pattern (this is the same as setting the Pattern property of the Interior object to xlPatternNone).

The following table shows the color-index values in the default color palette.

Color

Index value

Aqua

8, 28, 33, 34, 42

Black

1, 51, 52

Blue

5, 32, 41, 49

Fuchsia

7, 26

Gray

16, 46, 47, 48, 56

Green

10, 43

Lime

4

Maroon

9, 30, 53

Navy

11, 25, 55

Olive

12, 44, 45

Purple

13, 18, 21, 29, 54

Red

3

Silver

15, 17, 20, 22, 24, 35, 36, 37, 38, 39

Teal

14, 23, 31, 50

White

2, 19, 40

Yellow

6, 27


See Also

Color property, Colors property, Pattern property, PatternColor property.

Example

This example sets the color of the interior pattern for rectangle one on Sheet1.

With Worksheets("Sheet1").Rectangles(1).Interior
    .Pattern = xlChecker
    .PatternColorIndex = 5
End With