View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_7_] Bob Phillips[_7_] is offline
external usenet poster
 
Posts: 1,120
Default Do Until problem

David,

How about

Do
...
Loop Until Round(var1,2) = Round(var2,2)


--
HTH

Bob Phillips

"David Goodall" wrote in message
...
Morning
I've set up a do until loop but it doesn't stop when the two conditions
appear to be the same.

The two variable I'm comparing are declared as Double and I think that's
where the problem lies. When I debug the watches are as follows:-

Variable1 = 39779.4028
Variable2 = 39779.4028

They appear to be the same but I'm thinking that not all the decimals are
being shown. I only need the answers to 2 decimal points ie 39779.40 so
would you suggest casting the double to another variable type.

Hope this makes sense.
Thanks
David