ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   =IF Color (https://www.excelbanter.com/excel-programming/415771-%3Dif-color.html)

Jeff-B[_2_]

=IF Color
 
Is there a way to use the color of a cell in an IF statement?

FSt1

=IF Color
 
hi
since you post in programming, i assume you are looking for a code solution
and not a formula solution.

Sub JeffBIfColor()
If Range("G4").Interior.ColorIndex = 3 Then 'red
MsgBox "it's red"
Else
MsgBox "it's not red"
End If

End Sub

regards
FSt1

"Jeff-B" wrote:

Is there a way to use the color of a cell in an IF statement?


Jeff-B[_2_]

=IF Color
 
Thank you so much I will give it a try. I didn't think a formula solution
was possible so I thought I would have go the programming route. Is there an
easy formula solution?

"FSt1" wrote:

hi
since you post in programming, i assume you are looking for a code solution
and not a formula solution.

Sub JeffBIfColor()
If Range("G4").Interior.ColorIndex = 3 Then 'red
MsgBox "it's red"
Else
MsgBox "it's not red"
End If

End Sub

regards
FSt1

"Jeff-B" wrote:

Is there a way to use the color of a cell in an IF statement?


Gord Dibben

=IF Color
 
There is no formula solution using Excel's built-in functions.

If the color is due to Conditional Formatting you could use the IF function
based upion the condition.

Elsewise you need a macro or a UDF


Gord Dibben MS Excel MVP

On Sat, 16 Aug 2008 15:47:00 -0700, Jeff-B
wrote:

Thank you so much I will give it a try. I didn't think a formula solution
was possible so I thought I would have go the programming route. Is there an
easy formula solution?

"FSt1" wrote:

hi
since you post in programming, i assume you are looking for a code solution
and not a formula solution.

Sub JeffBIfColor()
If Range("G4").Interior.ColorIndex = 3 Then 'red
MsgBox "it's red"
Else
MsgBox "it's not red"
End If

End Sub

regards
FSt1

"Jeff-B" wrote:

Is there a way to use the color of a cell in an IF statement?



Bob Phillips[_3_]

=IF Color
 
See http://xldynamic.com/source/xld.ColourCounter.html

--
__________________________________
HTH

Bob

"Jeff-B" wrote in message
...
Is there a way to use the color of a cell in an IF statement?





All times are GMT +1. The time now is 06:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com