View Single Post
  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default Auto color-shading of rows

It will with a slight modification. This will work on any change in column M
(13)

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Column = 13 Then
With Target
Select Case .Value
Case 424: .EntireRow.Interior.ColorIndex = 6
Case 426: .EntireRow.Interior.ColorIndex = 35
Case 436: .EntireRow.Interior.ColorIndex = 41
Case "TAU": .EntireRow.Interior.ColorIndex = 45
'etc
End Select
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub


'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Fitz" wrote in message
.. .
I appreciate the feedback but I don't understand this code at all. In
reality, I'm looking for 4 different color scenarios: if "424" is written

in
a cell in a specific column of an excel worksheet then the row, in its
entirety, associated with that "424"cell will be highlighted in YELLOW, if
"426" is written in that same column in any particular cell then the
complete row associated with that cell would be hightlighted in LIGHT

GREEN,
if "436" is written in that same column in any particular cell then the
complete row associated with that cell would be hightlighted in LIGHT

BLUE,
if "TAU" is written in that same column in any particular cell then the

row
associated with that cell would be hightlighted in LIGHT ORANGE. Will this
macro work on each worksheet in the workbook? Appreciate your feedback.
Fitz