Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options | Excel Discussion (Misc queries) | |||
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 | Excel Worksheet Functions | |||
change Excel Cell forecolor using VB6 | Excel Discussion (Misc queries) | |||
change forecolor with code | Excel Discussion (Misc queries) | |||
How to create/run "cell A equals Cell B put Cell C info in Cell D | Excel Discussion (Misc queries) |