Results 1 to 2 of 2
2005-04-16, 17:12 #1
- Join Date
- Feb 2002
- Harrisburg, Pennsylvania, USA
- Thanked 0 Times in 0 Posts
if then for changing color (windows xp)
I am looking for an if then statement that I can use in a cell that will say "if cell a2 is x then cell b5 should have the color of green or red or something. I would also like to know where I can find the listing of colors that I can use within the formula if I decide to change the cell color at some time.
Thanks for the help.
2005-04-16, 18:19 #2
- Join Date
- Mar 2002
- Thanked 29 Times in 29 Posts
Re: if then for changing color (windows xp)
You cannot change the color of a cell in a cell formula. You can use conditional formatting, or code in the Worksheet_Change event.
Here is how to do it using conditional formatting:
- Select cell B5
- Select Format | Conditional Formatting...
- Select "Formula Is" in the dropdown list.
- Enter =(A2=3) in the box next to it.
- Click Format...
- If you want to set the font color, select it in the Font tab; if you want to set the background color, set it in the Pattern tab.
- Click OK.
- You can add up to two additional conditions, each with their own formatting.
- Click OK when done.