Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jun 2, 8:53*am, Mark Kubicki
wrote: I have some VBA code to change the font color of a row; however, nothing *changes... * any suggestions? It starts with a "change event" that triggers the function: * * * * * * Private Sub Worksheet_Change(ByVal target As Range) * * * * * * * * Application.Run UpdateRowColor(target) then the function runs like this: * * * * * * Function UpdateRowColor(target) * * * * * * 'This section effects changes to the "Project Phase" column * * * * * * If Not Intersect(target, Range("A:A")) Is Nothing Then * * * * * * * * If target.Count 1 Then * * * * * * * * * * Exit Function * * * * * * * * Else * * * * * * * * * * Select Case target.Value * * * * * * * * * * Case Is = "CA" * * * * * * * * * * * * Range(target.Row & ":" & target.Row).Font.ColorIndex = 45 * * * * * * * * * * Case Is = "CD" * * * * * * * * * * * * *... (one (but only 1) of the cells in any given row has a "conditoinal formatting") *thanks in advance, *mark This works fine for me. In the sheet that you want this to take place in: Private Sub Worksheet_Change(ByVal target As Range) Application.Run UpdateRowColor(target) End Sub In a standard module: Function UpdateRowColor(target As Range) 'This section effects changes to the "Project Phase" column If Not Intersect(target, Range("A:A")) Is Nothing Then If target.Count 1 Then Exit Function Else With target Select Case .Value Case Is = "CA" Rows(.Row).Font.ColorIndex = 45 Case Is = "CD" Rows(.Row).Font.ColorIndex = 5 End Select End With End If End If End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
update code | Excel Discussion (Misc queries) | |||
Code to conditional format all black after date specified in code? | Excel Discussion (Misc queries) | |||
vba code...... on update........... | Excel Programming | |||
How can I update VBA code in a module that is running my VBA code? | Excel Programming | |||
code to update a macro | Excel Programming |