Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Variant valiables problem
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
To get a sum for variant currency values | Excel Discussion (Misc queries) | |||
String to Variant incorrect conversion | Excel Worksheet Functions | |||
How do I assign range to variant and use | Excel Discussion (Misc queries) | |||
Started out as an Access problem. Now an Excel problem | Excel Discussion (Misc queries) | |||
problem with a conditional max problem | Excel Discussion (Misc queries) |