View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
adrian adrian is offline
external usenet poster
 
Posts: 4
Default Help Needed: Calculation error

When I run the following code:

Public Sub test()
Cells(1, 3).Value = Cells(1, 1).Value - Cells(1,
2).Value * 0.000001
End Sub


with input data:
A1=0.035
A2=35000

I expect to get A3=0; however I get A3 = 6.94E-18!

Can anyone explain why and how this can be avoided?

Thank you in advance for your help,

Adrian F.
Ottawa