5

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?

chrisaycock
  • 36,470
  • 14
  • 88
  • 125
Matthew C
  • 75
  • 1
  • 2
  • 4
  • `Shapes` is a collection, you need to specify which index you're working with. Also, forms and activex controls are wildly different, and don't work the same at all. – Mathieu Guindon Feb 20 '17 at 18:44

1 Answers1

8

Just try it like this:

ActiveSheet.CommandButton1.BackColor = RGB(220, 105, 0)
pokemon_Man
  • 902
  • 1
  • 9
  • 25
  • Ye it works after i add Activesheet.CommandButton1.BackColor = RGB(220, 105, 0). I should have tried it before. Thanks – Matthew C Feb 20 '17 at 17:19