Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA code to automatically colour cells depending on text? | Excel Discussion (Misc queries) | |||
Conditional Formatting - Code to colour 3+ text values differently | Excel Discussion (Misc queries) | |||
How do I fix cells that print differently than shown? | Excel Discussion (Misc queries) | |||
Link cells in a workbook and be able to sort differently | New Users to Excel | |||
Colour negative border differently | Charts and Charting in Excel |