Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default colour cell on condition

hey
i need a code wich will change the collour of a cell when the user enter the
word "off".
so when he enter "off" in c5 i need c5 to turn bright yelow..
(will this go in the worksheet change?)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default colour cell on condition

On Apr 28, 5:24 pm, pswanie wrote:
hey
i need a code wich will change the collour of a cell when the user enter the
word "off".
so when he enter "off" in c5 i need c5 to turn bright yelow..
(will this go in the worksheet change?)


Try Conditional Formatting.

Go to Format - Conditional Formatting

If cell value is equal to off, then click "Format...", go to the
Patterns tab and change the color to a bright yellow.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default colour cell on condition

thats how and what they do now. but i want to automate the colour change...

and i forgot. any word (open, close, off) must if possible be in caps. if
caps aint on it must change the word to caps
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default colour cell on condition

On Apr 28, 6:07 pm, pswanie wrote:
thats how and what they do now. but i want to automate the colour change...

and i forgot. any word (open, close, off) must if possible be in caps. if
caps aint on it must change the word to caps


I obtained the code in the body by simply recording a macro and doing
the conditional formatting. The code will change the color of a cell
to yellow if the user inputs the word "off". The code will sit in a
Worksheet_Change event sub:

Private Sub Worksheet_Change(ByVal Target As Range)

Target.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""off"""
Target.FormatConditions(1).Interior.ColorIndex = 6

End Sub

I'm not sure how to do the caps part, best wait for a reply from the
more experienced users on that one.
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
Condition depending on tab colour excel Excel Worksheet Functions 3 July 15th 07 10:23 PM
Condition based on cell colour Richhall Excel Worksheet Functions 2 March 25th 07 04:23 PM
auto change cell text colour resulting from a condition Chinaman Excel Worksheet Functions 2 December 14th 06 01:19 AM
Choosing offset on condition found in combobox change colour of cell?? Simon Lloyd[_813_] Excel Programming 2 July 4th 06 12:53 AM
Change the Row Colour, using a cell condition belgarth58 Excel Discussion (Misc queries) 1 February 7th 06 07:42 PM


All times are GMT +1. The time now is 09:06 PM.

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"