Hi all,
i have sheet calls Statistic and lots of tables on it. I was wondering if someone could help me to write code that will do true all cells on that sheet and if there are any cell value < 0 to change that cell color to red.
Thanks
Hi all,
i have sheet calls Statistic and lots of tables on it. I was wondering if someone could help me to write code that will do true all cells on that sheet and if there are any cell value < 0 to change that cell color to red.
Thanks
range("A1").select
While ActiveCell.Value <> ""
If ActiveCell.Value < 0 Then
With ActiveCell.Interior
.ColorIndex = vbRed
.Pattern = xlSolid
End With
End If
ActiveCell.Offset(1, 0).Select 'next row
Wend
Conditional Formatting will do that without the need for VBA.