JSINISCALCHI
New Member
- Joined
- Jul 17, 2007
- Messages
- 5
I am trying to convert the following macro to a Worksheet (section change) format, but cannot figure out how to have the cells B87:M150 change based upon the text (red, green, white, amber, na) in O87150.
Sub ordinate()
Dim r As Range
For Each r In Range("o87150")
If r.Value = "RED" Then
r.EntireRow.Interior.ColorIndex = 3
ElseIf r.Value = "AMBER" Then
r.EntireRow.Interior.ColorIndex = 44
ElseIf r.Value = "WHITE" Then
r.EntireRow.Interior.ColorIndex = 2
ElseIf r.Value = "GREEN" Then
r.EntireRow.Interior.ColorIndex = 4
ElseIf r.Value = "NONE" Then
r.EntireRow.Interior.ColorIndex = 2
ElseIf r.Value = "NA" Then
r.EntireRow.Interior.ColorIndex = 15
End If
Next
Range("N86:IV132").Interior.ColorIndex = 2
Range("A86:A132").Interior.ColorIndex = 2
End Sub
Sub ordinate()
Dim r As Range
For Each r In Range("o87150")
If r.Value = "RED" Then
r.EntireRow.Interior.ColorIndex = 3
ElseIf r.Value = "AMBER" Then
r.EntireRow.Interior.ColorIndex = 44
ElseIf r.Value = "WHITE" Then
r.EntireRow.Interior.ColorIndex = 2
ElseIf r.Value = "GREEN" Then
r.EntireRow.Interior.ColorIndex = 4
ElseIf r.Value = "NONE" Then
r.EntireRow.Interior.ColorIndex = 2
ElseIf r.Value = "NA" Then
r.EntireRow.Interior.ColorIndex = 15
End If
Next
Range("N86:IV132").Interior.ColorIndex = 2
Range("A86:A132").Interior.ColorIndex = 2
End Sub