Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Do Until problem
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Colon at the end of excel file name(ex: problem.xls:1, problem.xls | New Users to Excel | |||
Started out as an Access problem. Now an Excel problem | Excel Discussion (Misc queries) | |||
problem with a conditional max problem | Excel Discussion (Misc queries) | |||
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? | Excel Programming |