I need some cells to change colour depending on a condition.
If the cell reads "OK" it must be green and if it reads "Order!" it must be red.
Example attached.
Help please?![]()
Conditional formating is for this purpose.
regards
johnjohns
When you are not sure where to go, every road takes you there!
1. Paint cell as Red color
2. Conditional formatting -> New Rule -> Format cell that contain -> Cell value, equal to, "OK" -> format (green cell)
(P.S. Your profile said you using XL 2003 but example is newer version).
"Relax. What is mind? No matter. What is matter? Never mind!"
Hi,
Assuming the value checked for is allways in column f
Steffen ThomsenSub test() Dim CurCell As Object For Each CurCell In Range("F1:F20") ' adjust to langht of stock If CurCell.Value = "OK" Then CurCell.Select With Selection.Interior .Color = 5296274 End With ElseIf CurCell.Value = "Order" Then CurCell.Select With Selection.Interior .Color = 255 End With End If Next End Sub
[QUOTE=ahav;2526886]I need some cells to change colour depending on a condition.
If the cell reads "OK" it must be green and if it reads "Order!" it must be red.
QUOTE]
Because your file is in excel 2007 I cand't open and I've atached one of mine.
In the file atached try to type OK or Order in the first 35 cels (A2-A35) and see what happens
Again, I think Zbor gave the shortest, simple most solution. Filling the cell with Red color first and then using conditional formatting, change the color to green, if the cell value is "OK". That is the easiest.
regards
johnjohns
When you are not sure where to go, every road takes you there!
Thx johnjohns.
Always when there a 2 criterias (possible) one formatting should be default and other solved by CF.
that's how resources are saved.
"Relax. What is mind? No matter. What is matter? Never mind!"
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks