Change color depending on cell value
one way:
Dim rCell As Range
For Each rCell In Range(Cells(1, 5), Cells(Rows.Count, 5).End(xlUp))
With rCell
If IsNumeric(.Value) Then _
If .Value < 0 Then _
.Offset(0, -4).Resize(1, 5).Interior.ColorIndex = 3
End With
In article ,
"Gary Paris" wrote:
I would like to Loop through my worksheet and if the value in Column 5 is
negative, I would like to color all 5 cells in that particular row red also.
I don't want to do this in conditional formatting, but I would like to know
how to "brute force" do this in code.
|