VBA RGB单元格颜色规范

时间:2014-09-29 09:55:11

标签: vba rgb

我想用RGB更改单元格颜色:212,231,237和i记录宏如下:

Sub Macro2()
    With Selection.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .Color = 15591380
        .TintAndShade = 0
        .PatternTintAndShade = 0
    End With
End Sub

我想知道.Color = 15591380

是怎么回事

由于

1 个答案:

答案 0 :(得分:1)

RGB代码就是这样;)

Sub Macro2()
    With Selection.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .Color = RGB(212, 231, 237)
        .TintAndShade = 0
        .PatternTintAndShade = 0
    End With
End Sub