Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

Set the color for whole range

Sub ColorCells4()    Dim Rng As Range       For Each Rng In Range("A1:E5")       If Rng.Value < 100 Then          Rng.Font.ColorIndex = 4       Else          Rng.Font.ColorIndex = 1       End If    Next Rng End Sub