View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Find all cell with a decimal value

Try this:

Sub findum()
Dim r As Range
Set r = Nothing
For Each cel In ActiveSheet.UsedRange
v = cel.Value
If IsNumeric(v) And v < "" Then
If v - Int(v) < 0 Then
If r Is Nothing Then
Set r = cel
Else
Set r = Union(r, cel)
End If
End If
End If
Next
MsgBox r.Address
r.Select
End Sub
--
Gary''s Student - gsnu201001


"Steven" wrote:

I am in a blank sheet in a worksheet.

Is there a way to return all the cells within the worksheet that have a
value behind the decimal? For example: 1,245.00 would not be returned
because it is 0 after the decimal but 1,245.01 would be returned. I am only
looking for this to 2 decimal places.

Thank you,

Steven