Skip to main content

Interior.PatternColorIndex property

Table of contents
  1. Syntax
  2. Remarks
  3. Example

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.



expression A variable that represents an Interior object.


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).


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

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>