Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 743
- Office Version
- 365
- 2019
- Platform
- Windows
Greetings, I have the following Macro which works flawlessly in hi-lighting a row if it contains a specific word or phrase.
I would like the row to highlight if there is a different value in it. I tried simply as another piece to it, but it errored out on me. The piece I was trying to add was
I ended up with this code (below) which of course did not work. I could created a who new Macro but I have too many in this projec already. Thank You .
VBA Code:
Sub Local_BACKGROUND()
Sheets("72 Hr").Select
endrow = Range("E" & Rows.Count).End(xlUp).Row
For Each cell In Range("E3:E" & endrow)
If cell.Value = "LOCAL" Then
Range(Cells(cell.Row, "A"), Cells(cell.Row, "E")).Interior.ColorIndex = 6
End If
Next
End Sub
I would like the row to highlight if there is a different value in it. I tried simply as another piece to it, but it errored out on me. The piece I was trying to add was
VBA Code:
If cell.Value = "CUST & AG REQ" Then
Range(Cells(cell.Row, "A"), Cells(cell.Row, "E")).Interior.ColorIndex = 44
I ended up with this code (below) which of course did not work. I could created a who new Macro but I have too many in this projec already. Thank You .
VBA Code:
Sub Local_BACKGROUND()
Sheets("72 Hr").Select
endrow = Range("E" & Rows.Count).End(xlUp).Row
For Each cell In Range("E3:E" & endrow)
If cell.Value = "LOCAL" Then
Range(Cells(cell.Row, "A"), Cells(cell.Row, "E")).Interior.ColorIndex = 6
For Each cell In Range("E3:E" & endrow)
If cell.Value = "CUST & AG REQ" Then
Range(Cells(cell.Row, "A"), Cells(cell.Row, "E")).Interior.ColorIndex = 44
End If
Next
End Sub