Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkbox to change background color, font color and remove/ add bo Sara Excel Discussion (Misc queries) 2 May 1st 23 11:43 AM
Cannot change font color or cell color Bezell Excel Discussion (Misc queries) 2 January 30th 09 06:12 PM
Change in font and color dberger16 New Users to Excel 4 January 22nd 09 04:26 PM
how can I conditionally change font color, or background color? MOHA Excel Worksheet Functions 3 August 21st 06 06:57 PM
How to change the default Border, Font Color, and Cell Color Elijah Excel Discussion (Misc queries) 3 November 2nd 05 11:52 PM


All times are GMT +1. The time now is 02:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"