Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
change font color for row...
i have this line of code to change the font color of a row; however, nothing
changes... any suggestions? Range(target.Row & ":" & target.Row).Font.ColorIndex = 3 thanks in advance, mark |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
change font color for row...
If is was set by conditional formatting then you will need:
Range(target.Row & ":" & target.Row).FormatConditions(1).Font.ColorIndex = 3 "Mark Kubicki" wrote: i have this line of code to change the font color of a row; however, nothing changes... any suggestions? thanks in advance, mark |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
change font color for row...
nope...
there is 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 (only) of the cells n the row has a "conditoinal formatting" "JLGWhiz" wrote in message ... If is was set by conditional formatting then you will need: Range(target.Row & ":" & target.Row).FormatConditions(1).Font.ColorIndex = 3 "Mark Kubicki" wrote: i have this line of code to change the font color of a row; however, nothing changes... any suggestions? thanks in advance, mark |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
change font color for row...
Sorry to take so long getting back. I set up your code on my system and it
worked as intended. I can only suggest that you step through the code line by line to see if it performs as you intended with the data in your workbook. In case you don't know how to do that, just right click on the sheet that contains the code, then click View Code. On the second line of the Worksheet_Change macro, click on the left frame of the code window to set a breakpoint. You should see a dark dot on the frame and a dark line across the code line. Then click your workbook icon at the bottom of the screen to bring the worksheet into focus. Make a change in the target range and press enter or click another cell. This should return you to the VB editor where you can use the F8 key to step through the rest of the code. Good luck. "Mark Kubicki" wrote: nope... there is 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 (only) of the cells n the row has a "conditoinal formatting" "JLGWhiz" wrote in message ... If is was set by conditional formatting then you will need: Range(target.Row & ":" & target.Row).FormatConditions(1).Font.ColorIndex = 3 "Mark Kubicki" wrote: i have this line of code to change the font color of a row; however, nothing changes... any suggestions? thanks in advance, mark |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Checkbox to change background color, font color and remove/ add bo | Excel Discussion (Misc queries) | |||
Cannot change font color or cell color | Excel Discussion (Misc queries) | |||
Change in font and color | New Users to Excel | |||
how can I conditionally change font color, or background color? | Excel Worksheet Functions | |||
How to change the default Border, Font Color, and Cell Color | Excel Discussion (Misc queries) |