Excel VBA changing color for CommandButton

38,799

Just try it like this:

ActiveSheet.CommandButton1.BackColor = RGB(220, 105, 0)
Share:
38,799
Matthew C
Author by

Matthew C

Updated on February 21, 2020

Comments

  • Matthew C
    Matthew C about 4 years

    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?