On Mar 7, 9:12 pm, "jimmy" <edpo...@hotmail.com> 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
|