PatternColorIndex 属性

       

返回或设置内部图案的颜色,表示为当前调色板中的颜色编号或以下 XlColorIndex 常量之一:xlColorIndexAutomaticxlColorIndexNoneLong 类型,可读写。

说明

将本属性设置为 xlColorIndexAutomatic,表示指定单元格的自动图案或绘图对象的自动填充样式。将本属性设置为 xlColorIndexNone,则表示不希望使用图案(等价于将 Interior 对象的 Pattern 属性设置为 xlPatternNone)。

说明

下列图示给出了默认调色板中的颜色编号值。

默认调色板中的颜色编号值

示例

本示例对 Sheet1 中矩形一的内部图案的颜色进行设置。

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