View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default help with variable division

i am using 2 variables, tmpWt and tmpTime. weight is in pounds, time is in
minutes.
they are both dimmed as double

the 2 variables always have to correct values, yet when i try to divide the
weight by the time, the number is always a whole number and it's always wrong.

for example:

tmpwt = 2000
tmpTime = 23.5294
ws2.Range("P" & nextRow).Value = tmpWt \ tmpTime
the value in the cell is 83.00
the correct answer is 85.00

another one:
tmpwt =120
tmpTime =1.666
the cell value is 60.00
the correct value is 72.28
i can put the variable values in cells adjacent to column P and they're right,
but the division is incorrect.

anyone know why?

--


Gary