如下:这是微信截图的样式,QQ截图,或者其他的截图软件,亦是同理,都会显示RGB颜色,不知道RGB,就去截一下图,一看便知
Sub color_test()
'RGB格式(微信截图,QQ截图,以及其他的截图工具都会有RGB的颜色提示)
Cells(1, 1).Interior.Color = RGB(255, 255, 0) '设置背景颜色为黄色
Cells(1, 1).Font.Color = RGB(255, 0, 0) '设置字体颜色为红色
'ColorIndex格式(下面会有颜色对应序列参照表)
Cells(1, 1).Interior.ColorIndex = 1 '设置背景颜色为黑色
Cells(1, 1).Font.ColorIndex = 2 '设置字体颜色为白色
End Sub