Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to change the color of ActiveX Control button in Excel?

In Excel, when you insert a command button, the color of the button is grey by default. But sometimes, you need to change the grey color to a beautiful color to make the worksheet more professional. Today, I can introduce you some quick tricks to change the color of the button in Excel.

Change the color of ActiveX Control button with changing the properties

Change the color of ActiveX Control button with VBA code


You may interest in:

Easily batch insert checkboxes or option buttons in selection in Excel

You can easily insert multiple checkboxes or option buttons in a selection in Excel as below screenshot shown

Kutools for Excel includes more than 300 handy Excel tools. Free to try with no limitation in 60 days. Read More      Download the free trial now

Excel Productivity Tools

Office Tab: Bring powerful tabs to Office (include Excel), just like Chrome, Safari, Firefox and Internet Explorer. Save you half the time, and reduce thousands of mouse clicks for you. 30-day Unlimited Free Trial

Kutools for Excel: Save 70% of your time and solve 80% Excel problems for you. 300+ advanced features designed for 1500+ work scenario, make Excel much easy and increase productivity immediately. 60-day Unlimited Free Trial


Change the color of ActiveX Control button with changing the properties


Normally, in Excel, there are two types of button, one is Form Control button and the other is ActiveX Control button. If the button is Form Control button, you can just change the font color of it, but don’t change the background color. You just can change the back color of the ActiveX Control button. Please do as this:

1. Insert the ActiveX Control button by clicking Developer > Insert, and select Command Button under ActiveX Controls section, see screenshot:

doc-change-button-color1

Note: If the Developer tab doesn't show in the ribbon, you can click File > Option > Customize Ribbon, then check Developer in the right pane to display the Developer tab.

2. Then drag the mouse to draw a button.

doc-change-button-color1

3. And then select the button and right click, choose Properties from the context menu, and in the popped out Properties dialog, click Alphabetic tab, and then click BackColor drop down list to choose one color you like, see screenshots:

doc-change-button-color3 -2 doc-change-button-color4

4. Then close the dialog, and the color of your command button has been changed as follows:

doc-change-button-color1

5. At last, quit the Design Mode by clicking Developer > Design Mode to make the button use normally.


Change the color of ActiveX Control button with VBA code

As we can see, Excel provides a few of colors in the Properties dialog box for us to apply. With the following simple VBA code, there are lots of colors to be chosen.

1. Insert a command button, and right click, then choose View Code from the context menu, see screenshot:

doc-change-button-color1

2. Then a Microsoft Visual Basic for Applications window will display, see screenshot:

doc-change-button-color1

3. And then copy and paste this simple code script: CommandButton1.BackColor = 12713921 into the window between the two code, see screenshot:

doc-change-button-color1

Note: In the above code script, the CommandButton1 is the name of your button, and the number 12713921 is the MS-Accessnumber, they are all variable, you can change them as your need.

4. Then press F5 key to run this code, and your button color has been changed at once.

doc-change-button-color1

Tip: You can go to this website: http://www.endprod.com/colors/ to view more MS-Access number color values, there are maybe hundreds of colors you can use. After opening the website, you just need to choose a color and copy the corresponding number under MSAccess herder, then replace the above number in the code script.

doc-change-button-color1


Excel Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 70%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 80% Excel problems.

  • Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  • Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  • Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  • Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  • No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  • Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  • 60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  • Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    rashed · 1 years ago
    I want to colour command button for specific time. like when i enter code in button, button color would be change for 40 minutes and than normal
  • To post as a guest, your comment is unpublished.
    moe · 2 years ago
    hey, when i right clikck, it didnt show propperties so I chose properties from the Developer tool bar, and I didnt get options like backcolor. what should i do?
    • To post as a guest, your comment is unpublished.
      Amit · 2 years ago
      First click on DESIGN MODE under devloper tab, now right click on activex button.

      Now properties is visible
    • To post as a guest, your comment is unpublished.
      Amit · 2 years ago
      First click on design mode under devloper tab then select button and right click.
      Now properties option is visible ;-)
  • To post as a guest, your comment is unpublished.
    Steve · 2 years ago
    This works for a Toggle Button ...I expect a simple Command Button would be similar.

    With ToggleButton1
    If .Value Then
    .ForeColor = RGB(0, 0, 0)
    .BackColor = RGB(0, 255, 0)
    .Caption = "Caption if toggled on."
    Else
    .ForeColor = RGB(0, 0, 0)
    .BackColor = RGB(255, 255, 0)
    .Caption = "Caption if toggled off"
    End If
    End With
  • To post as a guest, your comment is unpublished.
    Alexander · 4 years ago
    I'm trying to find a way to use a command button or toggle buttons to change the forecolor from white to green. Is there a simplistic way to do that?