I have this code:
It does exactly as I want it to do, however I want cells B3 - J3 and so on down to B13 - J13 to turn a certain colour instead of just the individual cell changing. I have modified the code to "Target.EntireRow", but it's not the entire row I need. Any help would be greatly appreciated.Private Sub Worksheet_Change(ByVal Target As Range)
Set MyPlage = Range("J3:J13")
For Each Cell In MyPlage
If Cell.Value = "On Duty" Then
Cell.Interior.ColorIndex = 4
End If
If Cell.Value = "Off Duty" Then
Cell.Interior.ColorIndex = 3
End If
If Cell.Value = "Incident" Then
Cell.Interior.ColorIndex = 3
End If
If Cell.Value = "Off Route" Then
Cell.Interior.ColorIndex = 46
End If
If Cell.Value = "Broken Down" Then
Cell.Interior.ColorIndex = 46
End If
If Cell.Value = "Welfare Break" Then
Cell.Interior.ColorIndex = 46
End If
If Cell.Value = "Change Over" Then
Cell.Interior.ColorIndex = 46
End If
If Cell.Value <> "On Duty" And Cell.Value <> "Off Duty" And Cell.Value <> "Incident" And Cell.Value <> "Off Route" And Cell.Value <> "Broken Down" And Cell.Value <> "Welfare Break" And Cell.Value <> "Change Over" Then
Cell.Interior.ColorIndex = xlNone
End If
Next
End Sub
Bookmarks