Donate SIGN UP

Excel conditional colouring of cells......

Avatar Image
R1Geezer | 09:45 Thu 10th Sep 2009 | Technology
4 Answers
I have a cell containing a date, I would like to colour that cell based on the day of the week that the date represents so if it's a sunday it's blue etc etc. any idea how this miracle is to be achieved. Thanks
Gravatar

Answers

1 to 4 of 4rss feed

Best Answer

No best answer has yet been selected by R1Geezer. Once a best answer has been selected, it will be shown here.

For more on marking an answer as the "Best Answer", please visit our FAQ.
Click on the format menu and select conditional formatting.

Problem is you can only have 3 conditional formatting rules per cell

http://www.contextures.com/xlcondFormat01.html
ChuckF is right. If you want more than 3 conditions you need to write VBA code yourself for each cell.
Question Author
OK thanks I only need 1 rule because I can code an OR condition.
Not sure if you need this but I thought I'd post this macro for you just in case.

Dim rCell As Range

' Start Counter
For Each rCell In Range("A1:AT500")

' Check fot the correct criteria and chenge the colour appropriatly
' Do this for Red Monday, Amber Tuesday and Green Wednesday check on all cells in range
If UCase(rCell) = "Monday" Then
Range(rCell.Address).Select
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
ElseIf UCase(rCell) = "Tuesday" Then
Range(rCell.Address).Select
With Selection.Interior
.ColorIndex = 45
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
ElseIf UCase(rCell) = "Wednesday" Then
Range(rCell.Address).Select
With Selection.Interior
.ColorIndex = 50
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If
Next rCell

End Sub

1 to 4 of 4rss feed

Do you know the answer?

Excel conditional colouring of cells......

Answer Question >>

Related Questions

Sorry, we can't find any related questions. Try using the search bar at the top of the page to search for some keywords, or choose a topic and submit your own question.