Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default how I can Check the color of font in excel cell ?

Can I set a cell to equal 1 for a font colored "RED" in another cell , such as:
if cell B1 is "RED" font colored i need cell C1 to be =1
Thanks

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,365
Default how I can Check the color of font in excel cell ?

As far as I know, you cannot test font color with a worksheet function. You
can do so in VBA code like
If Range("B1").Font.ColorIndex = 3 Then
Range("C1") = 1
End If

If the font color in B1 is controlled by conditional formatting, you could
set up a similar test for value in C1.

Lets say you used Conditional Formatting in B1 to set font color to red when
its value is greater than 100, then in C1 you could use similar logic with an
IF function:
=IF(B1100,1,0)



"im-EGY" wrote:

Can I set a cell to equal 1 for a font colored "RED" in another cell , such as:
if cell B1 is "RED" font colored i need cell C1 to be =1
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default how I can Check the color of font in excel cell ?

If you add this Chip Pearson UDF to amodule in your workbook you can construct a
formula.

Function CellColorIndex(inRange As Range, Optional _
OfText As Boolean = False) As Integer
'
' This function returns the ColorIndex value of a the Interior
' (background) of a cell, or, if OfText is true, of the Font in the cell.
'
Application.Volatile True
If OfText = True Then
CellColorIndex = inRange.Font.ColorIndex
Else
CellColorIndex = inRange.Interior.ColorIndex
End If
End Function

In C1 enter =IF(cellcolorindex(B1,TRUE)=3,1,"")


Gord Dibben MS Excel MVP

On Thu, 21 Sep 2006 03:16:01 -0700, im-EGY
wrote:

Can I set a cell to equal 1 for a font colored "RED" in another cell , such as:
if cell B1 is "RED" font colored i need cell C1 to be =1
Thanks


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
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
In Excel, how can i see all tabs in format cell - I only see font. Jared Excel Discussion (Misc queries) 1 October 28th 05 09:55 PM
How do I add a check mark in a cell in a spreadsheet in Excel? Carlos A. Excel Discussion (Misc queries) 9 July 6th 05 01:52 AM
Pasting Word table cell with paragraph markers into single Excel c Steve Excel Discussion (Misc queries) 1 June 16th 05 11:26 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


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