show a whole row in a color if a condition is met in a single cell

A

abc

hi all

i'd like to show a whole row in red color if one cell of the row
contains a value e.g. "y"

i tried conditional formatting bu it only works on single cells.

Any idea on how to do this?

thanks
 
F

FSt1

hi
conditional formating can work for the whole row.
high light the row. i recommend that you just high light the part of the row
that contains data and not the entire row.
assuming row 3.......
enter this...
formula is.......=$A$3="Y"..........format red.

regards
FSt1
 
J

JLGWhiz

To use this code, right click the sheet name tab for the sheet you want the
cells to change color in. Copy the code from the news reader into the sheet
code module. This code is written to change the color to red if a y is put
into any cell in Column B.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("B:B")) Is Nothing Then
If LCase(Range("B" & Target.Row).Value) = "y" Then
Rows(Target.Row).Interior.ColorIndex = 3
Else
Rows(Target.Row).Interior.ColorIndex = xlNone
End If
End If
End Sub

If column B is not the column that you had in mind, then Change
Range("B:B") and Range("B" & Target.Row) values in quote marks to the column
you want to apply. The LCase function will allow the user to enter either
an upper case Y or lower case y and still activate the color. The Else
statement is in case an accidental entry is made with y and the correct
entry will cause the red color to go away.
 
P

Patrick Molloy

select all the cells ( ie click the 'box' above the number 1 in the rows and
left of A in the columns

select Format, Conditional formattinf, and use Formula Is
=COUNTIF(1:1,"Y")>0

make sure that calculation is automatic
 
A

abc

FSt1 said:
hi
conditional formating can work for the whole row.
high light the row. i recommend that you just high light the part of the row
that contains data and not the entire row.
assuming row 3.......
enter this...
formula is.......=$A$3="Y"..........format red.

That works thanks. How can I apply that to all the rows so that any row
where the cell in column A has a "Y" gets colored in red?

Thanks
 

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