Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to conditional color a named range in VBA code
I have a named 5x5 range called Costs in a VBA macro. I'd like
to fill the cells with a different color depending on their value. For example Sub Macro1()' Dim Costs As Variant Costs = Range("G2:K6").Select If Range.["Costs"] Then Select Case Range("Costs").Value Case Is <= 5: Target.Interior.Color = eColors.green Case Is <= 10: Target.Interior.Color = eColors.orange Case Is <= 15: Target.Interior.Color = eColors.yellow Case Else: Target.Interior.Color = eColors.red End Select End If End Sub Right now its not compiling any ideas? -- mark |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Conditional sum in a named range | Excel Discussion (Misc queries) | |||
Conditional formatting 'Named Range' dilemma | Excel Worksheet Functions | |||
VBA code to affect value of a named range | Excel Discussion (Misc queries) | |||
named range, conditional formatting | Excel Programming | |||
Named Range Fails in VBA Code | Excel Programming |