The code below works perfect except I want to highlight other cells in the same row where the text in column D equals one of the item#s (eg, Item1, Item2, etc). So for example, at this point, if cell D10 equals Item4, then it will be color shaded whatever # 36 is on the Excel pallette. I want that to happen but to also have A10, B10, C10, E10, F10, - L10 shaded the same color (#36). Is there a simple code change I can make?
Private Sub Worksheet_Calculate() Dim oCell As Range For Each oCell In Range("D3:D50") Select Case oCell.Value Case Is < 1 oCell.Interior.ColorIndex = xlNone Case Is = "Item1" oCell.Interior.ColorIndex = 24 Case Is = "Item2" oCell.Interior.ColorIndex = 14 Case Is = Item3" oCell.Interior.ColorIndex = 34 Case Is = "Item4" oCell.Interior.ColorIndex = 36 Case Is = "Item5" oCell.Interior.ColorIndex = 17 Case Is = "Item6" oCell.Interior.ColorIndex = 15 Case Is = "Item7" oCell.Interior.ColorIndex = 40 Case Is > 7 oCell.Interior.ColorIndex = xlNone End Select Next oCell End Sub
Bookmarks