Custom Colours for Checkboxes in User Forms Excel 2007

This guide will show you how to make a checkbox in Excel match the fill of a cell, background or text colour.

This guide is using Excel 2007.

Select the cell which has the fill you require, then in the Home ribbon select the fill icon, and click on More Colors…

Excel Colours

In the Colors dialogue select the Custom tab. Take a note of the RGB code for the fill of the cell. So in the screen shot the RGB is 255,204,153.

Colour Picker

 

Now you need to convert the RGB value to Hexadecimal. I would recommend using http://www.endprod.com/colors/rgb2hex.htm but you can always Google for a different converter.

Now with your Hex value you need to format it ready for input into Excel. The simple explanation is that for Excel you need to build a String to enter as the BackColor property.

The String will start with &H00 followed the Hex you just generated. However, you need to swap the last two characters of the hex string with the last, so if your Hex code is ffcc99 then you need to use 99ccff. So, now you have your string &H00*****, where the asterisks are replaced with your Hex code add a final & to the string and you are now ready to go.

Return to Excel, in the Developer tab on the Ribbon (to add Click the Microsoft Office Button, and then click Excel Options. Click Popular, and then select the Show Developer tab in the Ribbon check box) click on the Design Mode icon. Now single click on the CheckBox you want to change the color of and then in the Properties box enter your new color string in the BackColor, or if it is for the text color enter the string into the ForeColor property.