Number Format

D

DG

I have a macro with the following formula

OnProdOrd = (Cells(x, 10) - Cells(x, 11) / Cells(x, 9))

I'll use x = 1 for the example

Cells(1,10) = 10
Cells(1,11)= 0
Cells(1,9)= 0.5
The problem is that in Cell(x,9) the value is 0.5. But the program must be
rounding to 1 or making it an integer because OnProdOrd = 10 when it should
be 20 (10 - 0)/0.5.

How do I correct this?

Dan
 
P

Per Jessen

Hi

Just a little formula error (look at the parenthesises):


OnProdOrd = (Cells(x, 10) - Cells(x, 11)) / Cells(x, 9)

Regards,

Per
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top