PC Review


Reply
Thread Tools Rate Thread

change font color for row...

 
 
Mark Kubicki
Guest
Posts: n/a
 
      2nd Jun 2008
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


 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      2nd Jun 2008
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 With Quote
 
Mark Kubicki
Guest
Posts: n/a
 
      2nd Jun 2008
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" <(E-Mail Removed)> wrote in message
newsDB57AB3-A2F3-494C-BF21-(E-Mail Removed)...
> 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 With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      2nd Jun 2008
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" <(E-Mail Removed)> wrote in message
> newsDB57AB3-A2F3-494C-BF21-(E-Mail Removed)...
> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkbox to change background color, font color and remove/ add bo Sara Microsoft Excel Misc 1 11th Nov 2008 08:17 PM
How do I change the background color and font color in word docum MarieInLaguna Microsoft Word Document Management 1 13th Aug 2008 05:02 PM
How to change the default Border, Font Color, and Cell Color Elijah Microsoft Excel Misc 3 2nd Nov 2005 11:52 PM
Bullet Font Color Changes When I Change Text Color--Can I Change it Back? J. Danniel Microsoft Powerpoint 2 17th Mar 2005 08:06 PM
Change the font and font color for the desktop folder names Greg Campanella Windows XP Customization 0 26th Nov 2003 07:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:32 PM.