Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell ForeColor

Hi,

i need some ideas to implement a formula like ...

=IF(CellForeColor(D2)=RGB(255,0,0),"R","B")

if cell D2 text color is Red then the value will be "R", "B" if not.

thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Cell ForeColor

Function CHECKCOLOR(CL As Range) As String
Dim NUM As Integer


NUM = CL.Interior.ColorIndex
Select Case NUM
Case 6
CHECKCOLOR = "Y" 'YELLOW
Case 5
CHECKCOLOR = "B" 'BLUE
Case 46
CHECKCOLOR = "R" 'RED
Case Else
CHECKCOLOR = ""
End Select

End Function

= checkcolor(d2)
If you change a color you will have to force a calculation with Ctrl-Alt-F9
--
Carl & Linda Brehm
Lake Lafourche Bird House
Hebert, LA

Keets, Tiels, GN Lories, Quakers
Mitred Conures, TAG's, Bourkes
Lovebirds, Cherry Head Conures
Prince of Whales

Wholesale Cages to Breeders & Pet Stores
"JohnZing" wrote in message
...
Hi,

i need some ideas to implement a formula like ...

=IF(CellForeColor(D2)=RGB(255,0,0),"R","B")

if cell D2 text color is Red then the value will be "R", "B" if not.

thank you



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.717 / Virus Database: 473 - Release Date: 07/08/2004


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell ForeColor

thank you for your reply, but your code work well with cell background.
I need to evaluate the text color.

Carl Brehm said the following:
Function CHECKCOLOR(CL As Range) As String
Dim NUM As Integer


NUM = CL.Interior.ColorIndex
Select Case NUM
Case 6
CHECKCOLOR = "Y" 'YELLOW
Case 5
CHECKCOLOR = "B" 'BLUE
Case 46
CHECKCOLOR = "R" 'RED
Case Else
CHECKCOLOR = ""
End Select

End Function

= checkcolor(d2)
If you change a color you will have to force a calculation with Ctrl-Alt-F9

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
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options Yuvraj Excel Discussion (Misc queries) 0 June 29th 09 11:20 AM
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 [email protected] Excel Worksheet Functions 1 August 22nd 08 02:04 AM
change Excel Cell forecolor using VB6 Lennie Excel Discussion (Misc queries) 2 August 17th 08 12:27 AM
change forecolor with code Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 2 November 29th 07 05:24 PM
How to create/run "cell A equals Cell B put Cell C info in Cell D abmb161 Excel Discussion (Misc queries) 5 January 26th 06 06:36 PM


All times are GMT +1. The time now is 07:50 PM.

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

About Us

"It's about Microsoft Excel"