Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default Cell Function/Font Color

Is there a CELL Function that you can identify the color of a font with?
I would like part of a macro to make a decision based upon the color of the
font in a particular cell.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Cell Function/Font Color

Use font colorindex in your code.

Sub test_for_color()
With ActiveCell.Font
If .ColorIndex = 3 Then
MsgBox "got it right"
Else
MsgBox "not right"
End If
End With
End Sub

You could set the code up with Select Case for varying colors.


Gord Dibben MS Excel MVP


On Wed, 12 May 2010 13:18:05 -0700, HpyTrvlr69
wrote:

Is there a CELL Function that you can identify the color of a font with?
I would like part of a macro to make a decision based upon the color of the
font in a particular cell.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default Cell Function/Font Color

Thank you for your quick response. That worked like a charm.
Much Appreciated - HpY :)

"Gord Dibben" wrote:

Use font colorindex in your code.

Sub test_for_color()
With ActiveCell.Font
If .ColorIndex = 3 Then
MsgBox "got it right"
Else
MsgBox "not right"
End If
End With
End Sub

You could set the code up with Select Case for varying colors.


Gord Dibben MS Excel MVP


On Wed, 12 May 2010 13:18:05 -0700, HpyTrvlr69
wrote:

Is there a CELL Function that you can identify the color of a font with?
I would like part of a macro to make a decision based upon the color of the
font in a particular cell.


.

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
add fill color or font color to if function MEDaniel Excel Worksheet Functions 7 November 9th 08 07:09 AM
Font Color Function simserob Excel Worksheet Functions 2 August 20th 06 11:50 PM
Can I modify cell attributes (font,color etc.) based on function . TicklePig Excel Discussion (Misc queries) 4 December 4th 05 04:23 AM
How to change the default Border, Font Color, and Cell Color Elijah Excel Discussion (Misc queries) 3 November 2nd 05 11:52 PM
Default Border, Font Color, and Cell Background Color Elijah Excel Discussion (Misc queries) 1 October 28th 05 04:10 PM


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