Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2003 Object back colors

Status
Not open for further replies.

Sorwen

Technical User
Nov 30, 2002
1,641
US
This may be more common knowledge then I think, but I thought I would share my new knowledge with you just incase.

In a project I'm working on I allow user to use various colors to mark items. Not having the time to learn how to use some windows color chart or something I made my own. I use an object set to a back color, say blue, for color selection. While designing excel gives the color for blue as &H00FF0000&. Now first you might assume like me this is hex coloring and you would be half wrong. Second that when the color is set or passed in VBA it is done so with this number and you would be totally wrong. Rather than pass that &H00FF0000& it actually passes its own Long Integer number for blue 16711680. Isn't that nice.

Now you might be asking about the half wrong part. I'm not sure who was the moron first in all of this, but that &H00FF0000& number is actually the reverse (web/safe)hex color number. (Web/Safe) Hex blue is #0000FF (notice drop the #). The back color palette is limited in shade and doesn't match the color palette for cell colors and font colors. This would be the (Web/Safe) hex color for orange FF6600. So the back color is then &H000066FF&. The pallet color orange is &H000080FF&. The difference is slight, but if you want to use a color not on the palette but is useable as a background color this then helps.

That is likely more than you wanted to know, but since I had to figure this dyslexic way of looking at it. (No offence to anyone who may have dyslexia.) I get the urge to smack Microsoft several times a day.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top