Excel, how do you get the color of a cell, want to change the background color of a checkbox to match cell color

I have color a cell to match other borders on an excel sheet.  I dropped in a activex checkbox however the background color does not match.  When you go to properties you can change the color but standard selection list is very limited, however you can drop in the code "&H00801000&" . How do find code to match a given cell, and is there good reference for these codes.

wj
Bill_Jackson_TexasAsked:
Who is Participating?
 
nutschCommented:
I believe color index 55 would be
#333399 in HTML hex
(from what I gathered http://www.mvps.org/dmcritchie/excel/colors.htm)
0
 
nutschCommented:
You can use the following code to return the color index of the activecell in excel.
Sub GiveColor()
 
MsgBox "Cell color is " & selection.Interior.ColorIndex
 
End Sub

Open in new window

0
 
Bill_Jackson_TexasAuthor Commented:
Thanks,  the message box returns a code of 55, however the property box is looking for a code like
"&H00801000&"  How do you translate

wj
0
 
Bill_Jackson_TexasAuthor Commented:
nutsch - Thanks for pointing me in the right direction.  I found a solution that work by a little extra R&D.

1. Click on cell, go to fill color pallet, and get the RGB number.
2. Convert  the RGB number to Hex. http://www.javascripter.net/faq/rgbtohex.htm
3.  The format the background of an active x background is &H00BBGGRR& or 993333 instead of 333399 or the complete would be &H00993333&.  

Worked like a champ after I got it in the right order.

Thanks again.

wj
0
 
nutschCommented:
Thanks for posting your solution. Glad to have helped.

Thomas
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.