Variant valiables problem

B

bjdesa

Problems with VBA variant type variables when I define DIM SUM_1 as
double after running the main program the end results have decimal
places that dont match. This is drive me nuts yet when I define it as
variant type the final results have all the decimal digits matching
up. IS there something particular about

"RESP = 5.55 * 0.3048 * 0.3048 * SUM_1 / (0.252 * 1.8)"

Because if I did say Sum_2 = SUM1 and then used SUM_2 above instead of
SUM_1 then I get right digits it seems that the SUM_1 in the above
expression is the only one that matters. The answer changes if SUM_2
is defines as variant or double.


Sub bootfile(I_1, OUTFIT_1, ISHI_1, ISPI_1, COVER_1, JCOOL2_1, CLO_1,
ISUBMP_1, AIRC_1, LIQC_1)
Dim SUM_1
....................... some code
SUM_1 = 0#
....................... some code
SUM_1 = SUM_1 + H(L_1, IPLUS) / XKI(IG)
....................... some code
RESP = 5.55 * 0.3048 * 0.3048 * SUM_1 / (0.252 * 1.8)
....................... some code
End sub
 

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

Similar Threads


Top