2017-07-07 50 views

回答

0

使用此:

Label1.BackColor = sheets("sheet1").cells(2,2).DisplayFormat.Interior.Color 
+1

已解决。你的回答非常有帮助..谢谢 –

0

如果有兴趣使用细胞对象,那么可以尝试 - '使用Cell对象 细胞(3,2).Interior.ColorIndex = 5' 5表示蓝颜色

或者,如果你熟悉Range对象,那么你可以尝试 - “使用Range对象 范围(‘B3’)Interior.ColorIndex = 5

你也可以写使用RGB相同的代码如下: '使用单元格对象 个细胞(3,2)= .Interior.Color RGB(0,0,250) “使用范围的物体 范围( “B3”)。Interior.Color = RGB(0,0,250)

希望你觉得这很有帮助。

+0

如果我想将它应用到一个表单标签的背景是什么?就像我上面写的代码 –