Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default highlight row

Hello,

I'd like to be able to highlight a row if the cell value in column c
=3% and the call value in column f = 0. I only want to highlight the

rows for which these conditions are true.

Any ideas? Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default highlight row

Conditional formatting will work even with conditions across multiple cells,
but it cannot highlight an entire row. Here's a quick script that will check
each row based on the criteria you provided.

Sub highlightRows()
For i = 1 To ActiveSheet.UsedRange.Rows.Count
If (Cells(i, 3) 0.03 And Cells(i, 6) = 0) Then
With Rows(i).Interior
' Choose whichever color you prefer
.ColorIndex = 6 ' Yellow
.ColorIndex = 7 ' Pink
.ColorIndex = 42 ' Cyan
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If
Next i
End Sub

Since this is not conditional formatting, it will NOT update with value
changes. You can reset the rows using this next macro.

Sub resetRowHighlighting()
Cells.Interior.ColorIndex = xlNone
End Sub

If you really need the sheet to rehighlight after each change, consider
using the Worksheet_Change event.

HTH,
Pflugs

"Gary Brown" wrote:

Use Conditional Formatting.
--
HTH,
Gary Brown

If this post was helpful to you, please select
''''''''''''''''YES'''''''''''''''' at the bottom of the post.



"amanda" wrote:

Hello,

I'd like to be able to highlight a row if the cell value in column c
=3% and the call value in column f = 0. I only want to highlight the

rows for which these conditions are true.

Any ideas? Thanks.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default highlight row

On Jul 30, 11:00 am, Pflugs wrote:
Conditional formatting will work even with conditions across multiple cells,
but it cannot highlight an entire row. Here's a quick script that will check
each row based on the criteria you provided.

Sub highlightRows()
For i = 1 To ActiveSheet.UsedRange.Rows.Count
If (Cells(i, 3) 0.03 And Cells(i, 6) = 0) Then
With Rows(i).Interior
' Choose whichever color you prefer
.ColorIndex = 6 ' Yellow
.ColorIndex = 7 ' Pink
.ColorIndex = 42 ' Cyan
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If
Next i
End Sub

Since this is not conditional formatting, it will NOT update with value
changes. You can reset the rows using this next macro.

Sub resetRowHighlighting()
Cells.Interior.ColorIndex = xlNone
End Sub

If you really need the sheet to rehighlight after each change, consider
using the Worksheet_Change event.

HTH,
Pflugs



"Gary Brown" wrote:
Use Conditional Formatting.
--
HTH,
Gary Brown

If this post was helpful to you, please select
''''''''''''''''YES'''''''''''''''' at the bottom of the post.


"amanda" wrote:


Hello,


I'd like to be able to highlight a row if the cell value in column c
=3% and the call value in column f = 0. I only want to highlight the
rows for which these conditions are true.


Any ideas? Thanks.- Hide quoted text -


- Show quoted text -


Pflugs.............perfect. It works perfectly. Thank you. Amanda

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 178
Default highlight row

Just highlight the worksheet by selecting the area at the intersection of the
rows and columns (Between the 'A' and the '1') and then use the conditional
formatting instead of having to use a macro.
HTH,
Gary Brown

If this post was helpful to you, please select
''''''''''''''''YES'''''''''''''''' at the bottom of the post.



"Pflugs" wrote:

Conditional formatting will work even with conditions across multiple cells,
but it cannot highlight an entire row. Here's a quick script that will check
each row based on the criteria you provided.

Sub highlightRows()
For i = 1 To ActiveSheet.UsedRange.Rows.Count
If (Cells(i, 3) 0.03 And Cells(i, 6) = 0) Then
With Rows(i).Interior
' Choose whichever color you prefer
.ColorIndex = 6 ' Yellow
.ColorIndex = 7 ' Pink
.ColorIndex = 42 ' Cyan
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If
Next i
End Sub

Since this is not conditional formatting, it will NOT update with value
changes. You can reset the rows using this next macro.

Sub resetRowHighlighting()
Cells.Interior.ColorIndex = xlNone
End Sub

If you really need the sheet to rehighlight after each change, consider
using the Worksheet_Change event.

HTH,
Pflugs

"Gary Brown" wrote:

Use Conditional Formatting.
--
HTH,
Gary Brown

If this post was helpful to you, please select
''''''''''''''''YES'''''''''''''''' at the bottom of the post.



"amanda" wrote:

Hello,

I'd like to be able to highlight a row if the cell value in column c
=3% and the call value in column f = 0. I only want to highlight the
rows for which these conditions are true.

Any ideas? Thanks.


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
how to highlight more related cells if cell highlight Jon Excel Discussion (Misc queries) 5 December 21st 08 01:06 PM
Highlight active cell and de-highlight previous cell dmbuso Excel Programming 3 April 7th 07 04:22 PM
Highlight every other row Bri Excel Discussion (Misc queries) 2 April 5th 06 03:50 PM
Highlight cells with ctrl-click but only un-highlight one cell hagan Excel Discussion (Misc queries) 5 May 27th 05 06:45 PM
highlight row Frank Kabel Excel Programming 0 July 21st 04 07:57 AM


All times are GMT +1. The time now is 03:43 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"