ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   use option button background color to format cells (https://www.excelbanter.com/excel-programming/405807-use-option-button-background-color-format-cells.html)

Ken

use option button background color to format cells
 
I am trying to use the background color of an Optionbutton on a
worksheet (option button from forms toolbar) to change the pattern of
some cells. I am confused by the color numbering system. In one
instance the value associated with the OptionButton1.BackColor is
16777152. That causes an error when I try to assign it to my cell
range using

Range("B1_Team_top").Interior.ColorIndex=OptionBut ton1.BackColor

It looks in this case like the ColorIndex should be 34 for a similar
color. Are the numbering systems different and is there a way to
cross reference the value associated with the OptionButton.BackColor
to the number associated with the ColorIndex that looks the same?

Thanks

Ken

FSt1

use option button background color to format cells
 
hi
i think the default color system in xl is fairly constant but the colors can
be assigned in different ways.
see this site on xl colors and the different way to refer to them.
http://www.mvps.org/dmcritchie/excel/colors.htm

this may apply to 2003 and back only. i don't have 2007 yet but i was
reading up on the specs,
http://office.microsoft.com/en-us/ex...CH101030621033
and they are claiming 2007 has 16 million colors.
whoa!

regards
FSt1
"Ken" wrote:

I am trying to use the background color of an Optionbutton on a
worksheet (option button from forms toolbar) to change the pattern of
some cells. I am confused by the color numbering system. In one
instance the value associated with the OptionButton1.BackColor is
16777152. That causes an error when I try to assign it to my cell
range using

Range("B1_Team_top").Interior.ColorIndex=OptionBut ton1.BackColor

It looks in this case like the ColorIndex should be 34 for a similar
color. Are the numbering systems different and is there a way to
cross reference the value associated with the OptionButton.BackColor
to the number associated with the ColorIndex that looks the same?

Thanks

Ken


Ken

use option button background color to format cells
 
I have not found what I was looking for there yet, but, there is a lot
of great stuff. Thanks for the link.
Ken

On Feb 8, 12:33*pm, FSt1 wrote:
hi
i think the default color system in xl is fairly constant but the colors can
be assigned in different ways.
see this site on xl colors and the different way to refer to them.http://www.mvps.org/dmcritchie/excel/colors.htm

this may apply to 2003 and back only. i don't have 2007 yet but i was
reading up on the specs,http://office.microsoft.com/en-us/ex...aspx?pid=CH101...
and they are claiming 2007 has 16 million colors.
whoa!

regards
FSt1



"Ken" wrote:
I am trying to use the background color of an Optionbutton on a
worksheet (option button from forms toolbar) to change the pattern of
some cells. *I am confused by the color numbering system. *In one
instance the value associated with the OptionButton1.BackColor is
16777152. *That causes an error when I try to assign it to my cell
range using


Range("B1_Team_top").Interior.ColorIndex=OptionBut ton1.BackColor


It looks in this case like the ColorIndex should be 34 for a similar
color. *Are the numbering systems different and is there a way to
cross reference the value associated with the OptionButton.BackColor
to the number associated with the ColorIndex that looks the same?


Thanks


Ken- Hide quoted text -


- Show quoted text -




All times are GMT +1. The time now is 05:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com