change font color for row...

M

Mark Kubicki

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
 
J

JLGWhiz

If is was set by conditional formatting then you will need:

Range(target.Row & ":" & target.Row).FormatConditions(1).Font.ColorIndex = 3
 
M

Mark Kubicki

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"
 
J

JLGWhiz

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top