Changing Cell Fill Colour

N

Nick

I have a sheet where I enter different codes into the
cell. What I would like to do is when I enter a code the
cell background changes colour. There could be up to 10
codes so if I entered "AL" into a cell the background
could be RED or if I change the code to an "S" the cell
could be BLUE.
Is this possible?

All help appreciated

Nick
 
N

Nick

Thanks Bob
Does everyone who uses this worksheet need to have the
addin or does it stay with the sheet.
Hope this makes sense.

Nick
 
D

Don Guillett

Use a worksheet_event with select case to change your format,something like
this.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
With Target
Select Case Target.Value
Case Is >= 76
.Interior.ColorIndex = 3 '(red shade)
Case Is >= 52
.Interior.ColorIndex = 4 '(green shade)
Case Is >= 26
.Interior.ColorIndex = 46 '(orange shade)
Case Is >= 11
.Interior.ColorIndex = 41 '(blue shade)
Case Is >= 6
.Interior.ColorIndex = 6 '(yellow shade)
End Select
End With
End If
End Sub
 
B

Bob Phillips

Yes, that is a 'feature' of the addin, as it uses event code embedded in the
addin.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Top