#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Cell Colours

Many Thanks for all of your help guys, at long last I have an answer. due to
the fact that I know nothing about VB it was actually Rick who provided the
answer that, with my limited intelligence, I could actually understand and
make sense of. Once again a BIG thanks to all of you

Eddiec

"Rick Rothstein" wrote:

Give this Change event code a try...

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("B2:K99")) Is Nothing Then
Select Case Target.Value
Case "Deployed"
Target.Interior.ColorIndex = 3
Case "Awaiting"
Target.Interior.ColorIndex = 5
Case "Etc."
Target.Interior.ColorIndex = 10
Case Else
Target.Interior.ColorIndex = xlColorIndexNone
End Select
End If
End Sub

Change my example range of B2:K99 to whatever actual range of cells you want
to have this functionality... use Columns("B") in place of Range("B2:K99")
so cover all of column B (change the B to whatever actual column you want it
to apply to). Replace the "Etc." in my 3rd example Case statement with the
word or phrase you want to look for and add as many other Case
"<<YourWord" statements followed by the Target.Interior.ColorIndex
assignments as you need. NOTE: The Case Else sub-block **must** be last in
your list of Case sub-blocks. And, of course, change/use the ColorIndex
values you actually want.

To install this event code, right-click the tab at the bottom of the
worksheet, select "View Code" from the pop up menu that appears and
copy/paste the above code into the code window that appeared. That is it...
go back to the worksheet and enter some of your values into cells within the
range you specified and they should change colors accordingly.

--
Rick (MVP - Excel)


"Eddiec" wrote in message
...
I have been trying to find an answer to my question for months, but to no
avail.

I need to change the colours of cells based on different words I type in.
For example "Deployed" = Red Cell, "Awaiting" = Blue Cell etc...
Everywhere I
look people say use Conditional Formatting, however, this only allows
three
changes and I have a minimum of 10. From what I can gather I need to
program
some VB but unfortunately VB may as well be "Klingon".

I guess what I am asking is - could anyone provide a quick VB script that
could allow me to do what I need?

Pleeeeeeeeeeez help



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
How to save one of the MORE COLOURS in the THEME COLOURS? Wulfy Excel Discussion (Misc queries) 0 August 18th 09 10:25 AM
Cell Colours jmc Excel Discussion (Misc queries) 1 June 16th 07 03:06 PM
how do i get more colours for cell shading Trev Ellis Excel Discussion (Misc queries) 2 August 3rd 05 12:52 PM
Excel 2003 font colours and cell colours bretta Excel Discussion (Misc queries) 1 April 17th 05 03:45 AM
How to set different font colours in a cell? Sam Excel Worksheet Functions 1 March 29th 05 01:53 AM


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