Excel VBA changing color for CommandButton

眉间皱痕 提交于 2019-12-23 16:07:04

问题


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

Then in VBA I try:

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

This one works just fine.

But then I try:

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

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

Could you please help me with this?


回答1:


Just try it like this:

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


来源:https://stackoverflow.com/questions/42350388/excel-vba-changing-color-for-commandbutton

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!