Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default change the fore color

Which function is for changing the font color? and what is the color index?

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkbox to change background color, font color and remove/ add bo Sara Excel Discussion (Misc queries) 2 May 1st 23 11:43 AM
FLICKERING...(fore ground font color with flickering).. Eddy Stan Excel Discussion (Misc queries) 5 March 23rd 06 06:20 PM
change fill color of a range of cells based on color of a cell? DarMelNel Excel Programming 0 March 2nd 06 06:35 PM
How to change the default Border, Font Color, and Cell Color Elijah Excel Discussion (Misc queries) 3 November 2nd 05 11:52 PM
Browse Forms Controls and change TextBox color based on cell color StefanW Excel Programming 2 November 21st 04 07:06 PM


All times are GMT +1. The time now is 06:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"