Hello,
I am trying to get Excel to automatically change the color of a row depending on the entry in column H. I've got some VBA code written up, but I can't seem to get it to work. Am I making a programming mistake, or is it something else?
here's the code:
Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 8 Then Exit Sub 'Column 8 is column H (Status)
If Target.Row < 13 Then Exit Sub 'Row 13 is the first row of data
Application.EnableEvents = False
Select Case LCase(Target.Value) 'I dont know what case user will input data in
Case "maps issued"
Target.EntireRow.Interior.ColorIndex = 35
Case "complete"
Target.EntireRow.Interior.ColorIndex = 35
Case "confirmed"
Target.EntireRow.Interior.ColorIndex = 36
Case "waiting on team"
Target.EntireRow.Interior.ColorIndex = 40
Case "no show"
Target.EntireRow.Interior.ColorIndex = 22
Case "team cancelled"
Target.EntireRow.Interior.ColorIndex = 22
Case "sent up"
Target.EntireRow.Interior.ColorIndex = 36
Case Else
Target.EntireRow.Interior.ColorIndex = xlColorIndexAutomatic
End Select
Application.EnableEvents = True 'should be part of Change macro
End Sub
--Thanks
Configuration: Windows XP, Excel 2003
Reply to Excelguru
|
Conditional formatting checks only the value in a cell and NOT the formula in the cell
|