Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
single colour system for textboxes
As far as I can see, when playing with textboxes in VBA there are three
different ways to set the colour of a characteristic: RGB, SchemeColor or ColorIndex. BUT they aren't interchangeable. Some properties prefer one command (if you record a macro) but will accept another. To set the border colour or fill colour you can use RGB references RGB(255, 255, 255) or scheme colours SchemeColor = 65 but to set the font colour you can only use the colour index ColorIndex = 2 The above are 3 different ways to say WHITE. Is there a single form that will always work ? Doesn't look that way to me but hopefully the grand masters out there know a way. -- WinXP - Office2003 (Italian) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
single colour system for textboxes
You can reference a textbox both at the "old" DrawingObjects level or as a
Shape. Sub test() Dim shp as Shape Dim tbx as TextBox ' "TextBox" is a sub-type of Drawingobject Set shp = activesheet.Shapes("Text Box 1") Set tbx = activesheet.Textboxes("Text Box 1") Stop ' press alt-v,s to look in Locals ' expand shp, Fill, Backcolor and Forecolor, also look at Textframe ' expand tbx, Interior and Font End sub You'll notice Schemecolor is used in shp.Fill.Backcolor & forecolor, as well as RGB Schemecolor = 7 + colorindex Schemecolor 65 is system window background, typically white. If you want to apply colorindex 2 (by default white) apply schemecolor = +2 There's a bit more to it and in 2007 even more so, hopefully the above will get you there. Regards, Peter T "David Macdonald" wrote in message ... As far as I can see, when playing with textboxes in VBA there are three different ways to set the colour of a characteristic: RGB, SchemeColor or ColorIndex. BUT they aren't interchangeable. Some properties prefer one command (if you record a macro) but will accept another. To set the border colour or fill colour you can use RGB references RGB(255, 255, 255) or scheme colours SchemeColor = 65 but to set the font colour you can only use the colour index ColorIndex = 2 The above are 3 different ways to say WHITE. Is there a single form that will always work ? Doesn't look that way to me but hopefully the grand masters out there know a way. -- WinXP - Office2003 (Italian) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I open an Excel file on XP system, saved on a Vista system | Excel Discussion (Misc queries) | |||
Show Results in TextBoxes, ONLY if All TextBoxes have Data in them | Excel Programming | |||
Can I make different colour gridlines in a single chart in Excel? | Charts and Charting in Excel | |||
how do i assign a cel a colour system on a monthly report? | Excel Discussion (Misc queries) | |||
excel causing system to be in low system resource | Excel Discussion (Misc queries) |