Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
change the fore color
Which function is for changing the font color? and what is the color index?
Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
change the fore color
There are no excel function for changing fonts or colors except the
conditional formating. In VBA youhavve to select a cell or range and then change the Interior.colorindex or font.colorindex. Below is a macro that I gort using the Learn Macro to get an example of these statements. With Selection.Interior .ColorIndex = 6 .Pattern = xlSolid End With Selection.Font.ColorIndex = 3 "jimmy" wrote: Which function is for changing the font color? and what is the color index? Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
change the fore color
On Mar 7, 9:12 pm, "jimmy" wrote:
Which function is for changing the font color? and what is the color index? Thanks Jimmy, The color of font or the color of a cell is a property (i.e. an adjective) of the range object (i.e. a subject). In order to change the font color you must first specific a range object and then apply the font property and then apply the color index property followed by a color index number. All colors are made up of RBG, but unless you know the right combination of Red Blue and Green to make the colors that you want, it might be easier to use color index (which is predefined by Excel to include the palette in Menu Bar: Format/Cells/Patterns). Fromatting syntax is often best learned by using the macro recording. In short, you can search VBA help for colorindex to learn more. Otherwise, the following should help. Range("A1").Font.ColorIndex = 3 (Range Object is Range("A1"), .Font is a property describing "A1", .ColorIndex is also a property describing the font in "A1") Hopefully this helps. Matt |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Checkbox to change background color, font color and remove/ add bo | Excel Discussion (Misc queries) | |||
FLICKERING...(fore ground font color with flickering).. | Excel Discussion (Misc queries) | |||
change fill color of a range of cells based on color of a cell? | Excel Programming | |||
How to change the default Border, Font Color, and Cell Color | Excel Discussion (Misc queries) | |||
Browse Forms Controls and change TextBox color based on cell color | Excel Programming |