View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Sam Kuo[_3_] Sam Kuo[_3_] is offline
external usenet poster
 
Posts: 86
Default Cell color = Button face color. Possible?

Thanks Jon. I followed what the link said, but get a "run-time error 438"
after clicking the command button...Any idea?

Error occurs at this line:
Label1.BackColor = Combo1.ItemData(Combo1.ListIndex)



"Jon Peltier" wrote:

You need to use some VBA or similar magic to convert from the windows system
colors to RGB that you can apply to objects in Excel. Here's a couple
relevant links:

http://www.vbaccelerator.com/home/VB...OR/article.asp
http://www.vbaccelerator.com/tips/vba0018.htm

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Sam Kuo" wrote in message
...
Thanks FSt1. But RGB(220,220,220) appears to be "Grey-25%" in the standard
Excel color platte, not Button Face color??

I'm using Excel 2003.

Sam

"FSt1" wrote:

hi,
i don't have 2007. 2002 here. but the RGB equivilent to the button color
is
RGB(220,220,220). how you would adjust that in 2007, i don't know.
in 2002, i adust the colors using the RGB scale.

regards
FSt1

"Sam Kuo" wrote:

Is there an equivalent "color index" for "system color" in VBA?

e.g. I'm thinking to color cells the same as a default button face
color
(i.e. system color &H8000000F&) without having to create a shape or
button,
but it doesn't seem to be possible from this very useful link I found
in this
forum sometime ago...Is this right?

http://www.mvps.org/dmcritchie/excel/colors.htm

Sam