Skip to main content

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


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

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (7)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Thanks for this information (especially the color guide resource). But can we take it one step further? Are there ways to use code to make the button look more like a button? (shadow, bevel, etc) I know how to design a shape the way I want it and then assign a macro to it. But doing that seems to me to be a workaround at best. I'd prefer to do it with code if it's possible.
This comment was minimized by the moderator on the site
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
This comment was minimized by the moderator on the site
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?
This comment was minimized by the moderator on the site
First click on DESIGN MODE under devloper tab, now right click on activex button. Now properties is visible
This comment was minimized by the moderator on the site
First click on design mode under devloper tab then select button and right click. Now properties option is visible ;-)
This comment was minimized by the moderator on the site
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
This comment was minimized by the moderator on the site
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?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations