The title says it all. I have a cell range with 5 possible entries and need the backgrounds color coded to these entries. Some entries are dependant on other entries, so the change of one cell would effect others. It is very simple in design:
P = Yellow
T = Green
X = Gray
F = Dark Green
R = Red
For individual modification I have it set-up with:
Code
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer
If Not Intersect(Target, Range("E4:Q37, S4:W37, Y4:AF37, AH4:AO37")) Is Nothing Then
Select Case Target
Case "R", "r"
fcolor = 1
icolor = 3
Case "F", "f"
fcolor = 2
icolor = 10
Case "T", "t"
fcolor = 1
icolor = 43
Case "P", "p"
fcolor = 1
icolor = 6
Case "X", "x"
fcolor = 2
icolor = 16
Case Else
fcolor = 1
icolor = 0
End Select
Target.Value = UCase(Target.Value)
Target.Font.Bold = True
Target.Font.ColorIndex = fcolor
Target.Interior.ColorIndex = icolor
End If
End Sub
Display More
When I enter a P in one cell it will change another cell to a T, requiring both cells to be recolored, but this script only seems to do one cell. To make it simple, I'd like it to update the entire cell range based upon the individual cell contents whenever any single cell is modified.
Any ideas?