Skip to content
本页内容

Color (属性)

返回或设置对象的主要颜色,如注释部分中的表格所示。Any 型,可读写。

说明

对象对应颜色
Border边框的颜色。
Borders一个区域的所有四条边的颜色。如果四边不是同一种颜色,则 Color 返回的是 0(零)。
Font字体的颜色。
Interior单元格底纹的颜色或图形对象的填充颜色。
Tab选项卡的颜色。

示例

python
#此示例对 Chart1 中数值坐标轴的边框颜色进行设置
def test():
    Application.Charts.Item("Chart1").Axes(xlValue).Border.Color = RGB(0, 255, 0)
python
#本示例设置 H5 单元格左边框的颜色为红色
def test():
    Range("H5").Borders.Item(xlEdgeLeft).Color = RGB(255, 0, 0)