返回或设置边框的颜色。该颜色可指定为当前调色板中颜色的编号,或下列 XlColorIndex 常量之一。Variant 类型,可读写。
XlColorIndex 可为以下 XlColorIndex 常量之一。 |
xlColorIndexAutomatic |
xlColorIndexNone |
expression.ColorIndex
expression 必需。该表达式返回“应用于”列表中的对象之一。
应用于 Borders 对象的 ColorIndex 属性。
返回或设置四条边框的颜色。如果四条边框不是同一种颜色,则返回 Null。该颜色可指定为当前调色板中颜色的编号,或下列 XlColorIndex 常量之一。Variant 类型,可读写。
XlColorIndex 可为以下 XlColorIndex 常量之一。 |
xlColorIndexAutomatic |
xlColorIndexNone |
expression.ColorIndex
expression 必需。该表达式返回“应用于”列表中的对象之一。
返回或设置字体的颜色。该颜色可指定为当前调色板中颜色的编号,或下列 XlColorIndex 常量之一。Variant 类型,可读写。
XlColorIndex 可为以下 XlColorIndex 常量之一。 |
xlColorIndexAutomatic 指定自动设置颜色。 |
xlColorIndexNone. |
expression.ColorIndex
expression 必需。该表达式返回“应用于”列表中的对象之一。
应用于 Interior 对象的 ColorIndex 属性。
返回或设置边框内部的颜色。该颜色可指定为当前调色板中颜色的编号,或下列 XlColorIndex 常量之一。Variant 类型,可读写。
XlColorIndex 可为以下 XlColorIndex 常量之一。 |
xlColorIndexAutomatic 指定对绘图对象自动填充。 |
xlColorIndexNone 用于指定无内部填充。 |
expression.ColorIndex
expression 必需。该表达式返回“应用于”列表中的对象之一。
以下示例假定正在使用默认调色板。
本示例为 Chart1 中数值坐标轴的主要网格线设置了颜色。
With Charts("Chart1").Axes(xlValue)
If .HasMajorGridlines Then
.MajorGridlines.Border.ColorIndex = 5 'set color to blue
End If
End With
本示例将 Sheet1 的 A1 单元格的字体颜色改为红色。
Worksheets("Sheet1").Range("A1").Font.ColorIndex = 3
本示例将 Chart1 的图表区域内部颜色设为红色,将其边框的颜色设为蓝色。
With Charts("Chart1").ChartArea
.Interior.ColorIndex = 3
.Border.ColorIndex = 5
End With