Archive of Mr Excel Message Board
what i'm trying to do is conditional formating range a1:e1
1.turn to red = OR(A1:E1<40)
2. turn to blue = greater than 40
3. turn to grey = when there's nothing
above is the conditional formating i set for range a1:e1
no.1 and no.2 is no problem..my problem is no.3
what formula or cell value that I should put/set when
there is nothing in range a1:e1 to make it turn to grey..
and for your information..the range also includes
vlookup formula..many thanks

Type in for Condition 1: =AND(ISNUMBER(A1),A1<=40), Format = Red
Type in for Condition 2: =AND(ISNUMBER(A1),A1>40), Format = Blue
Type in for Condition 1: =LEN(A1)=, Format = Grey
After OK, click Format Painter then select the range in question. You're done.
Aladin
==========

That will do it. JSW

1. when there is marks under 39 and below in either 1 of the
range (a1,b1,c1,d1,e1,f1) , it will turn to red (any
one from the cell filled is enuff to turn it to red)
2. if there is 40 and above marks in range a1:f1
(all cell from a1:f1 must be filled with 40 or above
marks), it will turn to blue
3. if range a1:f1 is empty, it will turn to grey
(cell b2, d2 and f2 are set with vlookup formula)
(cell a1,c1,e1 is for user to keyin their marks)
i have succeeded with no.1 and no.2..my problem
is with no.3..when this is no marks in cell a1,c1
and e1..coz it turn to red..i need it to turn to grey..
hope you guys understand my question and can help
me..i try aladin and joe..but not working..many thanks
1. turn to red = OR(A1:F1<40) ==> i can do this
2. turn to blue = greater than 40 ==> i can do this
3. turn to grey = when there's nothing ==> this my problem

USE THE FORMULAS THAT I SUGGESTED EXACTLY (WITHOUT ANY DOLLARS IN THEM). YOU JUST SET UP ALL CONDITIONS FOR CELL A1 ONE BY ONE AS I DESCRIBED. THEN GO THE ICON BAR, HIT FORMAT PAINTER, THEN SELECT B1:F1 AND LET IT GO. EVERYTHING WILL BE OKAY EVEN FOR THE CELLS THAT HAVE A FORMULA.
Aladin
=============



I'm curious: Can you send me your try-out? Perhaps I'm not describing the steps as fully/clearly as needed.
Aladin

What do you mean by simultaneously? What I suggested will color the whole range cell by cell according what is in a given cell on the basis of conditions that you specified. Am I missing something?
PS. I can send you a workbook showing the whole thing if you wish.
Aladin



SURE IT DOES. MEA CULPA. With Format = Red I didn't mean a part of the formula to be entered; It was rather a shortcut to: "click Format on the conditional settings dialog, activate a tab then choose Red". It was a bad choice, especially because of the = sign.
Cheers.
Aladin

This is the best I can do, the problem is: If one cell in the range is 2(Red) and another 50(Blue) then the whole range will be Blue! It works by hierarchy or events. All empty then Gray, no cell over 40 then Red, any cell over 40 then Blue.
Sub ColorGet()
'
Dim vTest
Range("A1:F1").Select
'If value tests.
'Gray.
If Range("A1").Value = "" Or Range("B1").Value = "" Or _
Range("C1").Value = "" Or Range("D1").Value = "" Or _
Range("E1").Value = "" Or Range("F1").Value = "" Then
vTest = 3
End If
'Red.
If ((Range("A1").Value < 40 And Range("A1").Value <> 0)) Or _
((Range("B1").Value < 40 And Range("A1").Value <> 0)) Or _
((Range("C1").Value < 40 And Range("A1").Value <> 0)) Or _
((Range("D1").Value < 40 And Range("A1").Value <> 0)) Or _
((Range("E1").Value < 40 And Range("A1").Value <> 0)) Or _
((Range("F1").Value < 40 And Range("A1").Value <> 0)) Then
vTest = 1
End If
'Blue.
If Range("A1").Value >= 40 Or Range("B1").Value >= 40 Or _
Range("C1").Value >= 40 Or Range("D1").Value >= 40 Or _
Range("E1").Value >= 40 Or Range("F1").Value >= 40 Then
vTest = 2
End If
'Colors.
'Red.
If vTest = 1 Then
Selection.FormatConditions.Delete
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Else
'Blue.
If vTest = 2 Then
Selection.FormatConditions.Delete
With Selection.Interior
.ColorIndex = 41
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Else
'Gray.
If vTest = 3 Then
With Selection.Interior
Selection.FormatConditions.Delete
.ColorIndex = 15
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If
End If
End If
Range("A1").Select
End Sub
Hope this helps you. If the hierarchy of color events are not to your liking, re-order them!
I tested this with a Hot-key, Ctrl-c. It works fine and updates for new values with each Ctrl-c press. JSW
