Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi There,
I have a macro that changes the color of the cell "g4" as the cell changes numerical values in this code: Private Sub Worksheet_Change(ByVal Target As Range) If Not Application.Intersect(Range("g4"), Target) Is Nothing Then If Range("g4").Value 0 Then Range("g4").Cells.Interior.ColorIndex = 35 ElseIf Range("g4").Value < 0 Then Range("g4").Cells.Interior.ColorIndex = 38 Else Range("g4").Cells.Interior.ColorIndex = xlNone End If End If End Sub I would like to make it so that the color changes as cell values change for each cell from "g4" to "g16" I figure I can copy and paste this code in the private sub and then adjust the cell reference, but I imagine there is a much more simple and efficient method that I can't think of. Thanks for your help |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Control Toolbox and Private Sub Worksheet_Change(ByVal Target As R | Excel Discussion (Misc queries) | |||
Control Toolbox and Private Sub Worksheet_Change(ByVal Target As R | Excel Discussion (Misc queries) | |||
Private Sub Worksheet_Change(ByVal Target As Excel.Range) | Excel Programming | |||
Private Sub Worksheet_Change(ByVal Target As Excel.Range) | Excel Worksheet Functions | |||
Private Sub Worksheet_Change(ByVal Target As Range) | Excel Programming |