ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   show a whole row in a color if a condition is met in a single cell (https://www.excelbanter.com/excel-programming/427148-show-whole-row-color-if-condition-met-single-cell.html)

abc[_7_]

show a whole row in a color if a condition is met in a single cell
 
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

FSt1

show a whole row in a color if a condition is met in a single cell
 
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

"abc" wrote:

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


JLGWhiz[_2_]

show a whole row in a color if a condition is met in a single cell
 
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.



"abc" wrote in message ...
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




Patrick Molloy[_2_]

show a whole row in a color if a condition is met in a single cell
 
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


"abc" wrote:

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


abc[_7_]

show a whole row in a color if a condition is met in a singlecell
 
FSt1 wrote:
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


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com