PC Review


Reply
Thread Tools Rate Thread

change the fore color

 
 
jimmy
Guest
Posts: n/a
 
      8th Mar 2007
Which function is for changing the font color? and what is the color index?

Thanks


 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      8th Mar 2007
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
>
>
>

 
Reply With Quote
 
matt
Guest
Posts: n/a
 
      8th Mar 2007
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Fore Color in text box Phillip Microsoft Access Forms 1 5th Apr 2010 05:26 PM
change fore color of tab name Louis Microsoft Access Form Coding 1 12th Mar 2004 08:04 AM
change fore color for a cell retep Microsoft Access Forms 2 12th Feb 2004 02:18 PM
change fore color for a cell retep Microsoft Access 2 12th Feb 2004 02:18 PM
change fore color for a cell retep Microsoft Access Form Coding 2 12th Feb 2004 02:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:35 PM.