View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Equation Miscaculation

from the immediate window:
? val("10,000")
10
? cdbl("10,000")
10000

so you might want to use cdbl instead of Val.

--
Regards,
Tom Ogilvy

"helmekki" wrote in
message ...

Hi there
When I put this formating to the value of TextBoxs,


Code:
--------------------
Gtot.Value = Format(Gtot.Value, "#,##0.000")
tot.Value = Format(tot.Value, "#,##0.000")
bal.Value = Format(bal.Value, "#,##0.000")
--------------------


Then the result of this line is always 1 or not correct

Code:
--------------------
bal.Value = val(Gtot.Value) - val(tot.Value)
--------------------


How can get the correct result out of equation ?


--
helmekki


------------------------------------------------------------------------
helmekki's Profile:

http://www.excelforum.com/member.php...fo&userid=6939
View this thread: http://www.excelforum.com/showthread...hreadid=486844