You would need some changes to existing code.
Try this..................
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Num As Long
Dim Num2 As Long
Dim rng As Range
Dim vRngInput As Range
Set vRngInput = Intersect(Target, Range("D

"))
If vRngInput Is Nothing Then Exit Sub
On Error GoTo endit
Application.EnableEvents = False
For Each rng In vRngInput
'Determine the color
Select Case UCase(rng.Value)
Case Is = "A": Num = 10: Num2 = 2 'green and white
Case Is = "B": Num = 1: Num2 = 6 'black and yellow
Case Is = "C": Num = 5: Num2 = 2 'blue and white
Case Is = "D": Num = 7: Num2 = 1 'magenta and black
Case Is = "E": Num = 45: Num2 = 10 'orange and green
Case Is = "F": Num = 3: Num2 = 34 'red and light turquoise
End Select
'Apply the color
rng.Interior.ColorIndex = Num
rng.Font.ColorIndex = Num2
Next rng
endit:
Application.EnableEvents = True
End Sub
For a list of colorindex numbers see David McRitchie's site
http://www.mvps.org/dmcritchie/excel/colors.htm
Gord
- Show quoted text -