Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Conditional Formatting
How to include more than 3 conditions for formatting the cell ?
For example: if the cell values are A, B, C, D or E, the cell displays in a designated format. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Conditional Formatting
If you do mean that you want one designated format if the cell value is A,
B, C, D, or E, then you can use an OR function in your conditional formatting condition. Use Formula Is, not Cell Value Is. -- David Biddulph "yclhk" wrote in message ... How to include more than 3 conditions for formatting the cell ? For example: if the cell values are A, B, C, D or E, the cell displays in a designated format. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Conditional Formatting
I use a For-Next loop for this.
Place code behind worksheet - Presumes your data is in Column G, rows 2-500 For rwIndex = 2 To 500 For colIndex = 6 To 6 With Worksheets("Your Tab Name").Cells(rwIndex, colIndex) If .Value = "A" Then .Font.ColorIndex = 3 Else If .Font.ColorIndex = B Then .Font.ColorIndex = 4 Else End If End If End With Next colIndex Next rwIndex hth "yclhk" wrote: How to include more than 3 conditions for formatting the cell ? For example: if the cell values are A, B, C, D or E, the cell displays in a designated format. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Conditional Formatting
You could use event code to get more than 3 formats for a cell.
Private Sub Worksheet_Change(ByVal Target As Range) Dim Num As Long Dim rng As Range Dim vRngInput As Range Set vRngInput = Intersect(Target, Range("A1")) If vRngInput Is Nothing Then Exit Sub On Error GoTo endit Application.EnableEvents = False For Each rng In vRngInput 'Determine the color Select Case UCase(rng.Value) Case Is = "A": Num = 10 'green Case Is = "B": Num = 1 'black Case Is = "C": Num = 5 'blue Case Is = "D": Num = 7 'magenta Case Is = "E": Num = 46 'orange Case Is = "F": Num = 3 'red End Select 'Apply the color rng.Interior.ColorIndex = Num Next rng endit: Application.EnableEvents = True End Sub This is sheet event code. Right-click on the sheet tab and "View Code". Copy/paste the code into that sheet module. Alt + q to go back to Exel window. Adjust range and colors to suit. Gord Dibben MS Excel MVP On Wed, 19 Dec 2007 08:56:01 -0800, yclhk wrote: How to include more than 3 conditions for formatting the cell ? For example: if the cell values are A, B, C, D or E, the cell displays in a designated format. |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Conditional Formatting
Thanks for all. I think the solution of using OR function is more simple.
However, how to compose the formula in this formatting ? Thanks again for your help, "David Biddulph" wrote: If you do mean that you want one designated format if the cell value is A, B, C, D, or E, then you can use an OR function in your conditional formatting condition. Use Formula Is, not Cell Value Is. -- David Biddulph "yclhk" wrote in message ... How to include more than 3 conditions for formatting the cell ? For example: if the cell values are A, B, C, D or E, the cell displays in a designated format. |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Conditional Formatting
For conditionally formatting cell A1, use
=OR(A1="A",A1="B",A1="C",A1="D",A1="E") "yclhk" wrote in message ... Thanks for all. I think the solution of using OR function is more simple. However, how to compose the formula in this formatting ? Thanks again for your help, "David Biddulph" wrote: If you do mean that you want one designated format if the cell value is A, B, C, D, or E, then you can use an OR function in your conditional formatting condition. Use Formula Is, not Cell Value Is. -- David Biddulph "yclhk" wrote in message ... How to include more than 3 conditions for formatting the cell ? For example: if the cell values are A, B, C, D or E, the cell displays in a designated format. |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
Conditional Formatting
Thanks to Stephen, it works.
"Stephen" wrote: For conditionally formatting cell A1, use =OR(A1="A",A1="B",A1="C",A1="D",A1="E") "yclhk" wrote in message ... Thanks for all. I think the solution of using OR function is more simple. However, how to compose the formula in this formatting ? Thanks again for your help, "David Biddulph" wrote: If you do mean that you want one designated format if the cell value is A, B, C, D, or E, then you can use an OR function in your conditional formatting condition. Use Formula Is, not Cell Value Is. -- David Biddulph "yclhk" wrote in message ... How to include more than 3 conditions for formatting the cell ? For example: if the cell values are A, B, C, D or E, the cell displays in a designated format. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Protect Cell Formatting including Conditional Formatting | Excel Discussion (Misc queries) | |||
Conditional Formatting | Excel Worksheet Functions | |||
conditional Formatting based on cell formatting | Excel Worksheet Functions | |||
conditional Formatting based on cell formatting | Excel Worksheet Functions | |||
Conditional Formatting that will display conditional data | Excel Worksheet Functions |