Check text color in an IF statement

azo

New Member
Joined
May 19, 2011
Messages
5
What I need to do is check to see if a cell has a certain text color then provide me a true statement.

In B2: =IF(A2=Text Color Red, "Text 1")

Is that even possible in excel 2007?

Azo
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hi Azo,

I don't write or understand VBA, so I am unable to help you further with code, sorry.

Do you mean something like this?.....


Excel Workbook
ABC
1DataFont ColourFormula
2MrExcel1Not Red Font
3Test3Text 1
4Akashwani23Not Red Font
5Grass14Not Red Font
Sheet5



Press alt F11.
Click on Insert - Module
Paste this code into the white area....

Code:
Function txtColor(rng As Range)
txtColor = rng.Font.ColorIndex
End Function

Press alt F11.

You can now use this in your IF formula.....

txtColor(A2)=3

The formulas in B2:C2 in the sample data above need to be copied down.

I hope that works for you.

Good luck.

Ak
 
Upvote 0
Hi!

I have tested the suggested solution above and it works beautiful, but!
To update the cells I need to edit and press enter on each one of the, how do I do an update of all of the cell in one stroke?

Reg
Joakim
 
Upvote 0

Forum statistics

Threads
1,224,581
Messages
6,179,668
Members
452,936
Latest member
anamikabhargaw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top