Using the SpecialCells method: uses the Set keyword to create two new Range objects: the selection's subset that consists of cells with constants and the selection's subset that consists of cells with formulas. : SpecialCells « Excel « VBA / Excel / Access / Word
Using the SpecialCells method: uses the Set keyword to create two new Range objects: the selection's subset that consists of cells with constants and the selection's subset that consists of cells with formulas.
Sub SkipBlanks()
Dim ConstantCells As Range
Dim FormulaCells As Range
Dim cell As Range
On Error Resume Next
Set ConstantCells = Selection.SpecialCells(xlConstants)
For Each cell In ConstantCells
If cell.Value > 0 Then
cell.Interior.Color = vbRed
End If
Next cell
End Sub