i dont see what the problem is...

G

Guest

i have a program which was written in Basic, long time back. now i am trying
to write the same program in vba, i am using the same formulas used and
everything is the same, except the user interface and things. but i am struck
on one formula which doesnt give me the result it should.

C = 18.4686 - 3827.77 / DRY - 218140! / DRY ^ 2 (old, basic formula)
C = 18.4686 - (3827.77 / DRY) - (218140! / DRY ^ 2) (formula i use in vba)

this is the formula used in basic, but when i test it in vba, i get a
different result compared to what i get in the basic program. i tried to
calculate it using excel, but i still get a different result. i really cannot
see why, because the formula is the same and why is there a difference
between basic version, and vba version ??
can anybody please help..
 
D

Don Guillett

Since some of us might not speak basic, perhaps you could tell us what you
want to do.

what is the ! for
wha is DRY
 
G

Guest

So what results did you get in each case? (Need the value of "DRY").

P.S. The parentheses in the second formula are redundant, i.e. they can be
removed.
 
B

Bob Phillips

Try this

18.4686 - (3827.77 / DRY) - (218140! / Application.Power(DRY, 2))

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 
G

Guest

Thanks for your replies

DRY could be any value, in this instance its 69. i worked out the answer by
using a calculator, excel and in vba, but the same formula run through BASIC
doesnt give me the same result.

but, i think the problem is with the old program because, i wrote another
basic program with the same formula, same value for DRY and my reults match..
 

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