This appears to work, I just reformatted a little:
PHP Code:
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column <> 3 Then Exit Sub Dim cel As Range, Rng As Range Dim LR As Long LR = Range("A" & Rows.Count).End(xlUp).Row Set Rng = Range("H3:H" & LR)
For Each cel In Rng Select Case cel.Value Case vbNullString: cel.Interior.ColorIndex = xlNone Case "Out of Stock": cel.Interior.ColorIndex = 6 Case "None on Hand": cel.Interior.ColorIndex = 43 Case Is < 0.75: cel.Interior.ColorIndex = 3 Case 0.75 To 1: cel.Interior.ColorIndex = 45 Case Is > 1: cel.Interior.ColorIndex = 41 End Select Next cel
If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc ?Actually, I *am* a rocket scientist.? - JB (little ones count!)
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 3 Then Exit Sub
Dim cel As Range, Rng As Range
Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
Set Rng = Range("H3:H" & LR)
For Each cel In Rng
Select Case cel.Value
Case vbNullString
Range(Cells(cel.Row, "A"), Cells(cel.Row, "J")).Interior.ColorIndex = xlNone
Case "Out of Stock"
Range(Cells(cel.Row, "A"), Cells(cel.Row, "J")).Interior.ColorIndex = 6
Case "None on Hand"
Range(Cells(cel.Row, "A"), Cells(cel.Row, "J")).Interior.ColorIndex = 43
Case Is < 0.75
Range(Cells(cel.Row, "A"), Cells(cel.Row, "J")).Interior.ColorIndex = 3
Case 0.75 To 1
Range(Cells(cel.Row, "A"), Cells(cel.Row, "J")).Interior.ColorIndex = 45
Case Is > 1
Range(Cells(cel.Row, "A"), Cells(cel.Row, "J")).Interior.ColorIndex = 41
End Select
Next cel
End Sub
==========
If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].
(Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)
Bookmarks