Does this help?
Sub colorCell()
Dim i As Integer
i = 3
'change the 7 to what ever value you want the loop to work up to
Do Until i > 7
If Range("E" & i) = "slnt" And Range("G" & i).Value = 200 Then
Range("G" & i).Interior.Color = RGB(0, 176, 240)
ElseIf Range("E" & i) = "slnt" And Range("G" & i).Value = 460 Then
Range("G" & i).Interior.Color = RGB(112, 48, 160)
ElseIf Range("E" & i) = "slnt" And Range("G" & i).Value < 200 Then
Range("G" & i).Value = ""
Else
'Enter here what you want to happen when none of the conditions are met
End If
i = i + 1
Loop
End Sub
Bookmarks