Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cells automatically colour differently with 'what if' scenarios

I want to add YES or NO to a cell in EXCEL. If I type YES I want cell to
automatically colour GREEN. If I type NO I want cell to automatically colour
RED with the adjacent cell also to colour RED.
Any help apprecaited.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default cells automatically colour differently with 'what if' scenarios

Take a look at Conditional Formatting in XL Help.

In article ,
Kenny @ TLGC <Kenny @ wrote:

I want to add YES or NO to a cell in EXCEL. If I type YES I want cell to
automatically colour GREEN. If I type NO I want cell to automatically colour
RED with the adjacent cell also to colour RED.
Any help apprecaited.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default cells automatically colour differently with 'what if' scenarios

Hi

this can be achieved via conditional formatting
select the cell that you want to go green or red
choose format / conditional formatting
choose
value is
equal to
type
yes
click format - choose green - ok
choose ADD
choose
value is
type
no
click format - choose red - ok twice

now choose the cell that you want to go red if the previous cell goes red
choose format / conditional formatting
choose
formula is
type
=$A1="NO"
(where A1 is the cell reference of the previous cell)
click format ...etc

Cheers
JulieD



"Kenny @ TLGC" <Kenny @ wrote in message
...
I want to add YES or NO to a cell in EXCEL. If I type YES I want cell to
automatically colour GREEN. If I type NO I want cell to automatically
colour
RED with the adjacent cell also to colour RED.
Any help apprecaited.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default cells automatically colour differently with 'what if' scenarios

Look at Format=Conditional Formatting

you don't need code for this.

--
Regards,
Tom Ogilvy

"Kenny @ TLGC" <Kenny @ wrote in message
...
I want to add YES or NO to a cell in EXCEL. If I type YES I want cell to
automatically colour GREEN. If I type NO I want cell to automatically

colour
RED with the adjacent cell also to colour RED.
Any help apprecaited.



  #5   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default cells automatically colour differently with 'what if' scenario

this won't help the cell adjacent to it though

insert this in the worksheet object
but the interior.colorindex will change the background color
the font.colorindex will change the font color, since you did not specify
the one you needed I reccomend you comment out or delete the one you don't
want or else you will not see what you type


Private Sub Worksheet_Change(ByVal Target As Range)
if target.value = "YES" then
target.Font.ColorIndex = 4
target.Interior.ColorIndex = 4
end if
if target.value = "NO" then
range(cells(target.row,target.column),cells(target .row,target.column+1)).select
selection.Interior.ColorIndex = 3
selection.Font.ColorIndex = 3
end if
end sub
"JE McGimpsey" wrote:

Take a look at Conditional Formatting in XL Help.

In article ,
Kenny @ TLGC <Kenny @ wrote:

I want to add YES or NO to a cell in EXCEL. If I type YES I want cell to
automatically colour GREEN. If I type NO I want cell to automatically colour
RED with the adjacent cell also to colour RED.
Any help apprecaited.




  #6   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default cells automatically colour differently with 'what if' scenario

conditional formatting won't help the cell adjacent to it though

insert this in the worksheet object
but the interior.colorindex will change the background color
the font.colorindex will change the font color, since you did not specify
the one you needed I reccomend you comment out or delete the one you don't
want or else you will not see what you type


Private Sub Worksheet_Change(ByVal Target As Range)
if target.value = "YES" then
target.Font.ColorIndex = 4
target.Interior.ColorIndex = 4
end if
if target.value = "NO" then
range(cells(target.row,target.column),cells(target .row,target.column+1)).select
selection.Interior.ColorIndex = 3
selection.Font.ColorIndex = 3
end if
end sub


"JE McGimpsey" wrote:

Take a look at Conditional Formatting in XL Help.

In article ,
Kenny @ TLGC <Kenny @ wrote:

I want to add YES or NO to a cell in EXCEL. If I type YES I want cell to
automatically colour GREEN. If I type NO I want cell to automatically colour
RED with the adjacent cell also to colour RED.
Any help apprecaited.


  #7   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default cells automatically colour differently with 'what if' scenario

good point, never mind my post this is much smarter lol

"JulieD" wrote:

Hi

this can be achieved via conditional formatting
select the cell that you want to go green or red
choose format / conditional formatting
choose
value is
equal to
type
yes
click format - choose green - ok
choose ADD
choose
value is
type
no
click format - choose red - ok twice

now choose the cell that you want to go red if the previous cell goes red
choose format / conditional formatting
choose
formula is
type
=$A1="NO"
(where A1 is the cell reference of the previous cell)
click format ...etc

Cheers
JulieD



"Kenny @ TLGC" <Kenny @ wrote in message
...
I want to add YES or NO to a cell in EXCEL. If I type YES I want cell to
automatically colour GREEN. If I type NO I want cell to automatically
colour
RED with the adjacent cell also to colour RED.
Any help apprecaited.




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default cells automatically colour differently with 'what if' scenario

Of course it will...

Select A1 & B1

CF1: Formula is =($A1="YES")
Format1: Green

CF2: Formula is =($A1="NO")
Format2: Red

In article ,
ben wrote:

conditional formatting won't help the cell adjacent to it though

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
VBA code to automatically colour cells depending on text? mj_bowen Excel Discussion (Misc queries) 0 January 2nd 10 07:44 PM
Conditional Formatting - Code to colour 3+ text values differently AK9955 Excel Discussion (Misc queries) 3 November 9th 09 06:11 PM
How do I fix cells that print differently than shown? Jade Excel Discussion (Misc queries) 6 August 28th 09 09:02 PM
Link cells in a workbook and be able to sort differently Mex New Users to Excel 1 January 16th 07 01:54 AM
Colour negative border differently Mark Stephens Charts and Charting in Excel 1 August 10th 05 08:44 AM


All times are GMT +1. The time now is 12:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"