Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel VBA changing color for CommandButton

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?

like image 387
Matthew C Avatar asked Mar 10 '23 19:03

Matthew C


1 Answers

Just try it like this:

ActiveSheet.CommandButton1.BackColor = RGB(220, 105, 0)
like image 122
pokemon_Man Avatar answered Mar 20 '23 03:03

pokemon_Man