highlight row

A

amanda

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.
 
G

Guest

Use Conditional Formatting.
--
HTH,
Gary Brown
(e-mail address removed)
If this post was helpful to you, please select
''''''''''''''''YES'''''''''''''''' at the bottom of the post.
 
G

Guest

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
 
A

amanda

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






- Show quoted text -

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

Guest

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
(e-mail address removed)
If this post was helpful to you, please select
''''''''''''''''YES'''''''''''''''' at the bottom of the post.
 

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