B
Bob Wall
(Excel 97)
I'm making a schedule template, and I'd like to use more than 3 conditional
formats to color code certain fields (vacation, sick, training, holiday,
etc.)
Also, I am using a data validation list to make it easier for the users to
just click in the appropriate entries. I'd like certain entries in one color
(such as holiday or vacation in blue background) and others in different,
various colors (training in green, for example). Only certain fields should
be formatted like this, and a free text entry should remain in the default
format.
I have some code working, but it appears that the items entered from the DV
list won't drive the vb formatting...
Private Sub Worksheet_Change(ByVal Target As Range)
Set InRange = Intersect(ActiveSheet.Range("A1:A10, D1:100"), Target)
If Not InRange is Nothing then
If Target.Value = "A" Then
Target.Interior.ColorIndex = 3
ElseIf Target.Value = "B" Then
Target.Interior.ColorIndex = 4
ElseIf Target.Value = "C" Then
Target.Interior.ColorIndex = 5
End If
End if
End Sub
I sure would appreciate any help to make it easier.
Thanks in advance!
I'm making a schedule template, and I'd like to use more than 3 conditional
formats to color code certain fields (vacation, sick, training, holiday,
etc.)
Also, I am using a data validation list to make it easier for the users to
just click in the appropriate entries. I'd like certain entries in one color
(such as holiday or vacation in blue background) and others in different,
various colors (training in green, for example). Only certain fields should
be formatted like this, and a free text entry should remain in the default
format.
I have some code working, but it appears that the items entered from the DV
list won't drive the vb formatting...
Private Sub Worksheet_Change(ByVal Target As Range)
Set InRange = Intersect(ActiveSheet.Range("A1:A10, D1:100"), Target)
If Not InRange is Nothing then
If Target.Value = "A" Then
Target.Interior.ColorIndex = 3
ElseIf Target.Value = "B" Then
Target.Interior.ColorIndex = 4
ElseIf Target.Value = "C" Then
Target.Interior.ColorIndex = 5
End If
End if
End Sub
I sure would appreciate any help to make it easier.
Thanks in advance!