Home |
Search |
Today's Posts |
#1
|
|||
|
|||
... I would like to apply more than 3 conditional formats ...
I would like my Cells to be shaded based on the Values that are entered into
them. I thought that Conditional Formating would be the answer, but it appears I'm only able to enter three conditions. I have a posibility of five values that could be entered into the cells: "-", "1", "2", "3" or "4". The conditions I reqiure are" if the cell contains "-", then shade "light yellow" if the cell contains "1", then no shade if the cell contains "2", then shade "grey" if the cell contains "3", then shade "yellow" if the cell contains "4", then shade "red" Is there a means to enter more than the three conditions that are allowed by the dialog box? Respectfully, Darrell |
#2
|
|||
|
|||
... I would like to apply more than 3 conditional formats ...
Here is an example
Private Sub Worksheet_Change(ByVal Target As Range) Const WS_RANGE As String = "H1:H10" On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then With Target Select Case .Value Case 1: .Interior.ColorIndex = 3 'red Case 2: .Interior.ColorIndex = 6 'yellow Case 3: .Interior.ColorIndex = 5 'blue Case 4: .Interior.ColorIndex = 10 'green End Select End With End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH RP (remove nothere from the email address if mailing direct) "Dr. Darrell" wrote in message ... I would like my Cells to be shaded based on the Values that are entered into them. I thought that Conditional Formating would be the answer, but it appears I'm only able to enter three conditions. I have a posibility of five values that could be entered into the cells: "-", "1", "2", "3" or "4". The conditions I reqiure are" if the cell contains "-", then shade "light yellow" if the cell contains "1", then no shade if the cell contains "2", then shade "grey" if the cell contains "3", then shade "yellow" if the cell contains "4", then shade "red" Is there a means to enter more than the three conditions that are allowed by the dialog box? Respectfully, Darrell |
#3
|
|||
|
|||
... I would like to apply more than 3 conditional formats ...
Bob:
Thanks for the response. Do you mind if I ask you to disect the code and explain the meaning of each statement? Respectfully, Darrell "Bob Phillips" wrote: Here is an example Private Sub Worksheet_Change(ByVal Target As Range) Const WS_RANGE As String = "H1:H10" On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then With Target Select Case .Value Case 1: .Interior.ColorIndex = 3 'red Case 2: .Interior.ColorIndex = 6 'yellow Case 3: .Interior.ColorIndex = 5 'blue Case 4: .Interior.ColorIndex = 10 'green End Select End With End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH RP (remove nothere from the email address if mailing direct) "Dr. Darrell" wrote in message ... I would like my Cells to be shaded based on the Values that are entered into them. I thought that Conditional Formating would be the answer, but it appears I'm only able to enter three conditions. I have a posibility of five values that could be entered into the cells: "-", "1", "2", "3" or "4". The conditions I reqiure are" if the cell contains "-", then shade "light yellow" if the cell contains "1", then no shade if the cell contains "2", then shade "grey" if the cell contains "3", then shade "yellow" if the cell contains "4", then shade "red" Is there a means to enter more than the three conditions that are allowed by the dialog box? Respectfully, Darrell |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I Apply Conditional Formatting to a Chart? | Charts and Charting in Excel | |||
How do I apply conditional formatting to a text box | Excel Worksheet Functions | |||
Automatic updating of Conditional Formats using dates | Excel Worksheet Functions | |||
how do I apply more than 3 conditional formats in excel | Excel Discussion (Misc queries) | |||
Conditional Formats in Excel | Excel Worksheet Functions |