View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jay[_13_] Jay[_13_] is offline
external usenet poster
 
Posts: 1
Default skipping text formats

Hi:

The following program goes through a column of data and
highlights vlues over a certain constant. The only
problem is that it also highlights the cells with text
also? Can anybody show me how to highlight numbers only?

Thanks in advance for your help!

Sub ChangeCellBasedonValue()
Dim limit As Integer
limit = Range("k1").Value
For Each c In ActiveSheet.Range("e:e").Cells
If c.Value limit Then
With c.Font
.Bold = False
.Italic = False
.ColorIndex = 3
End With
With c.Interior
.ColorIndex = 14
End With
End If
Next c
MsgBox "All done!"
End Sub