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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set background of form txtbox to match cell color??? 3

Status
Not open for further replies.

VBAjedi

Programmer
Dec 12, 2002
1,197
KH
This must be so obvious that I can't see it:

How do you set the Backcolor of a textbox on a form to match the color specified by .Interior.ColorIndex of a cell?

I can't see how to get the hex value of a ColorIndex!

Thanks

VBAjedi [swords]
 
Easiest way is to not use the .colorindex but the .color of the interior object. If the colorindex is truly a palette index, then you can get the RGB color using
activeworkbook.colors(MyColorIndex),
but this doesn't work for the "special" color indexes, xlColorIndexNone and xlColorIndexAutomatic.


Rob
[flowerface]
 
Bueno, Rob and Skip - have a star!

Knew it was something fairly simple.

Now that I have your attention, would you mind looking at the new post I'm about to submit (if you haven't done so already). "Function causing created file to bloat?"

It's a wierd one. . .



VBAjedi [swords]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top