Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
I've got this function for each cell in the range "n7:is66".... =IF(AND(N$2=$K7,N$2<=$L7),IF($G7="On Track",2,IF($G7="Issues", 3,IF($G7="At Risk",4,IF($G7="Completed",5,1)))),"") and because conditional formating is too limited, I've got the below VBA changing the colors when $G7 through $G66 changes, it works fine when g7 is changed, but in order for the cells in n7:is66 to chang color, I have to click each one individually in order for them to change to their new color. So, how can these cells change color everytime colomn G on their row changes automatically? Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not Intersect(Target, Range("n7:is66")) Is Nothing Then Select Case Target Case 1 icolor = 41 Case 2 icolor = 10 Case 3 icolor = 6 Case 4 icolor = 3 Case 5 icolor = 1 Case Else 'whatever End Select End If Target.Interior.ColorIndex = icolor End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do I get my Data tab to work? It is completely greyed out. | Excel Discussion (Misc queries) | |||
Changing Worksheet State completely | Excel Programming | |||
worksheet change doesn't always work | Excel Discussion (Misc queries) | |||
worksheet change event doesn't work | Excel Programming | |||
Amend code or change it completely? | Excel Programming |