Thread: Cell Colours
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Eddiec Eddiec is offline
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