Gets or sets the color of the interior pattern as an index into the current color palette, or as one of the XlColorIndex values.
[Visual Basic] Property PatternColorIndex As Integer [C#] int PatternColorIndex { get; set; } [C++] __property int get_PatternColorIndex(); __property void set_PatternColorIndex(int ); [JScript] function get PatternColorIndex() : int function set PatternColorIndex(int);
The color index of the specified interior pattern.
Set this property to XlColorIndex.xlColorIndexAutomatic to specify the automatic pattern for cells. Set this property to XlColorIndex.xlColorIndexNone to specify that you don't want a pattern (this is the same as setting the Pattern property of the Interior interface to XlPattern.xlPatternNone).
This example sets the color index of the range A1:C10 interior pattern to 8.
[C#]
IInterior interior = book.Worksheets[1].Cells["A1:C10"].Interior;
interior.Pattern = XlPattern.xlChecker;
interior.PatternColorIndex = 8;
[Visual Basic]
Dim interior As IInterior = book.Worksheets(1).Cells("A1:C10").Interior
interior.Pattern = XlPattern.xlChecker
interior.PatternColorIndex = 8
[C++]
IInterior* interior = book->Worksheets->Item[1].Cells->Item[S"A1:C10"]->Interior;
interior->Pattern = XlPattern::xlChecker;
interior->PatternColorIndex = 8;
This example deletes interior pattern from a range A1:C5. [C#]
book.Worksheets[1].Range["A1:C5"].Interior.PatternColorIndex = XlColorIndex.xlColorIndexNone;
[Visual Basic]
book.Sheet(1).Range("A1:C5").Interior.PatternColorIndex = XlColorIndex.xlColorIndexNone
[C++]
IInterior* interior = book->Worksheets->Item[1]->Range->Item[S"A1:C5"]->Interior;
interior->PatternColorIndex = XlColorIndex::xlColorIndexNone;
IInterior Interface | NativeExcel Namespace | XlColorIndex Class | IPalette Interface | Colors Property | Interior Property