Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do I change this code to first apply the "If" to data in the cell across
in Column E of the current row (eg RC5), if it's true and the value in the current cell is greater than 0 then apply the formatting? Thanks in Advance BeSmart Private Sub Worksheet_Change(ByVal Target As Range) If Target.Value = "Cat" Then Target.Cells.Interior.ColorIndex = 1 ElseIf Target.Value = "Dog" Then Target.Cells.Interior.ColorIndex = 4 ElseIf Target.Value = "Horse" Then Target.Cells.Interior.ColorIndex = 5 ElseIf Target.Value = "Camel" Then Target.Cells.Interior.ColorIndex = 6 ElseIf Target.Value = "Pig" Then Target.Cells.Interior.ColorIndex = 7 Else Target.Cells.Interior.ColorIndex = xlnone End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional Formatting using code | Excel Discussion (Misc queries) | |||
Override conditional formatting with code | Excel Discussion (Misc queries) | |||
Evaluate conditional formatting in code | Excel Programming | |||
Conditional Formatting using VBA Code | Excel Programming | |||
conditional formatting vba code and calculation | Excel Programming |