Excel VBA为CommandButton更改颜色 [英] Excel VBA changing color for CommandButton

查看:571
本文介绍了Excel VBA为CommandButton更改颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在更改CommandButton的颜色时遇到问题.在电子表格中,我将设计按钮添加为表单或ActiveX.

I'm having problem with changing colors of my CommandButton. In the spreadsheet I add design button as form or ActiveX.

然后在VBA中尝试:

Activesheet.shapes("CommandButton1").visible = false 

这个很好用.

但是我尝试:

Activesheet.shapes.Fill.ForeColor.RGB = RGB(220, 105, 0)

它运行没有错误,但是没有任何变化.颜色保持不变.

It runs without error but nothing changes; color remains as it was before.

您能帮我吗?

推荐答案

只需尝试以下操作:

ActiveSheet.CommandButton1.BackColor = RGB(220, 105, 0)

这篇关于Excel VBA为CommandButton更改颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆