Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Simple Q about font color

How do I retrieve a fonts color? Do I access the color index number or is
there a text value that is a property of the font color?

TIA.

-gk-


--
=================================================
The creative act is not the province of remote oracles or rarefied geniuses
but a transparent process that is open to everyone.
-Greg Kot in Wilco Learning How To Die-


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Simple Q about font color

Each colour has it's own value.
eg this makes the selected cell(S) green. Yellow is 6 and
red is 3.
With Selection.Interior
.ColorIndex = 4
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With

BOL
DavidC
-----Original Message-----
How do I retrieve a fonts color? Do I access the color

index number or is
there a text value that is a property of the font color?

TIA.

-gk-


--
=============================================== ==
The creative act is not the province of remote oracles or

rarefied geniuses
but a transparent process that is open to everyone.
-Greg Kot in Wilco Learning How To Die-


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Simple Q about font color

I have no problem setting font properties. I need to access font properties
without changing them

For instance, cell A1 contains a text value. I want something like:

MsgBox Range("A1").Font.ColorIndex

-OR-

a = Selection.Font.ColorIndex


Of course, these don't work.

-gk-


"DavidC" wrote in message
...
Each colour has it's own value.
eg this makes the selected cell(S) green. Yellow is 6 and
red is 3.
With Selection.Interior
.ColorIndex = 4
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With

BOL
DavidC
-----Original Message-----
How do I retrieve a fonts color? Do I access the color

index number or is
there a text value that is a property of the font color?

TIA.

-gk-


--
=============================================== ==
The creative act is not the province of remote oracles or

rarefied geniuses
but a transparent process that is open to everyone.
-Greg Kot in Wilco Learning How To Die-


.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Simple Q about font color

What "doesn't work" about your statements?

Either will return 1 of the 56 colorindex values, or
xlColorIndexAutomatic (-4105).

Note if the selection contains more than one cell with different font
colors, Selection.Font.ColorIndex returns Null.


In article ,
"38N90W" wrote:

I have no problem setting font properties. I need to access font properties
without changing them

For instance, cell A1 contains a text value. I want something like:

MsgBox Range("A1").Font.ColorIndex

-OR-

a = Selection.Font.ColorIndex


Of course, these don't work.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple Q about font color

Hi,
I think MsgBox Range("A1").Font.ColorIndex works. Try next procedure.

Sub test_colorindex()
For i = 0 To 56
With Range("A1").Offset(i)
.Value = i
.Font.ColorIndex = i
.Offset(, 1).Value = .Font.ColorIndex
End With
Next i
End Sub

Jare

--
Message posted from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Simple Q about font color


"JE McGimpsey" wrote in message
...
What "doesn't work" about your statements?

Either will return 1 of the 56 colorindex values, or
xlColorIndexAutomatic (-4105).

Note if the selection contains more than one cell with different font
colors, Selection.Font.ColorIndex returns Null.



A Ha!

My text in question had different colors, which I hadn't noticed (long story
but a good reason for that).

Seems my problem just a got a bit more complex. Thanks!

-gk-


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
Conditional Format for font color using font color Jim Excel Worksheet Functions 2 August 29th 09 11:54 AM
Changing Font color based on font type or size John Excel Discussion (Misc queries) 2 February 7th 08 12:50 AM
fill color and font color icons do not work in excel huer59 Excel Discussion (Misc queries) 0 November 29th 07 01:06 PM
How to change the default Border, Font Color, and Cell Color Elijah Excel Discussion (Misc queries) 3 November 2nd 05 11:52 PM
My fill color and font color do not work in Excel Std Edition 2003 chapstick Excel Discussion (Misc queries) 1 September 11th 05 08:48 PM


All times are GMT +1. The time now is 11:06 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"