Hi,
Conditional Formatting should help you out, however, read the following if you want to do this in VBA.
To try to do this in VBA, use a Do...Loop Until, with an line of code such as, Loop Until ActiveCell = ""
Off the top of my head, you could do something like...
Sub HighlightCells()
Range("A1").select
Do
If Activecell.Value < 5 Then
Selection.Interior.ColorIndex = 3
End If
Activecell.offset(1,0).select 'moves activecell down one row.
Loop Until ActiveCell = ""
End Sub
Another thing you might want to do, in case you want to highlight with more than one color, is to use Select...Case.
From the previous code, remove the IF Statement and the two lines of code after it and code...
Select Case Activecell.Value
Case <5
Selection.Interior.ColorIndex = 3
Case 5, 6, 7, 8, 9, 10
Selection.Interior.ColorIndex = 6
Case >10
Selection.Interior.ColorIndex = 4
Case Else
'Do Nothing.
End Select.
You may need to do a Select Case to save nesting multiple IF statements and if you have more than 3 conditions you want to highlight for, because Conditional Formatting can only handle 3 different conditions.
Enjoy!
-Mike