Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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
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
Cell Color condition using IF... ELSE statement in Excel Nysh Excel Programming 5 November 19th 08 08:25 AM
Condition font color in a single cell based on its formula data. Bee Excel Worksheet Functions 3 February 19th 08 12:09 AM
cell color condition Can-Ann Excel Programming 7 January 23rd 08 01:42 AM
counting cell by color and condition Mark Excel Discussion (Misc queries) 1 April 22nd 07 04:56 PM
Using cell color as condition in equation John31 Excel Programming 2 January 7th 04 08:49 PM


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