Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell Color condition using IF... ELSE statement in Excel | Excel Programming | |||
Condition font color in a single cell based on its formula data. | Excel Worksheet Functions | |||
cell color condition | Excel Programming | |||
counting cell by color and condition | Excel Discussion (Misc queries) | |||
Using cell color as condition in equation | Excel Programming |