View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dana DeLouis Dana DeLouis is offline
external usenet poster
 
Posts: 947
Default Precision in Excle VBA

What kind of initial values do you have?

Sub Demo()
Dim TAssume
Dim TCalc
Dim TError

TAssume = 45
TCalc = 2

TError = Abs(TAssume - TCalc)
Do While TError = 0.3
TAssume = TAssume + 0.5 * (TCalc - TAssume)
TError = Abs(TAssume - TCalc)
Loop
Debug.Print TAssume
End Sub

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"duane" wrote in
message ...

yes i did, sorry should have added that to first post


--
duane


------------------------------------------------------------------------
duane's Profile:
http://www.excelforum.com/member.php...o&userid=11624
View this thread: http://www.excelforum.com/showthread...hreadid=561671