View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
gbink gbink is offline
external usenet poster
 
Posts: 4
Default if more than 2 decimal places

Thanks Sandy.

Your code is virtually identical to mine however I am finding the sometimes
the INT function is not returning expected results. e.g the cell contains
4.77 yet when I run the code I get a 'Less than 2dp' result.

when i put a watch in the code and examine INT(cell.value * 100) / 100 I get
4.76

G

"Sandy Mann" wrote:

One way:

If Int(Cells(1, 1) * 100) / 100 = Cells(1, 1) Then
MsgBox "Less"
Else
MsgBox "More"
End If

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"gbink" wrote in message
...
How can I determine programmatically within VBA whether or not the
contents
of a cell have more than 2 decimal places? Anyone able to help?