Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to find a way to have VBA give me the sum of multiple non-integers
to the 2nd decimal place. So far, I'm having no luck. I thought formatting the variable using "#,###.##" might work, but for the sum of 1.5 & 1 it gives me 2. (It doesn't give me 2.00, just 2. with a lone decimal place after the 2) What can I do to get VBA to recognize the decimal places? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
? 1.5 + 1.0
2.5 ? 1.475 + 2.322 3.797 If you are using variables, make sure they are declared as Single or Double or Variant. If you declared them as Long or Integer, then there's your huckleberry. These only hold whole numbers. (or assigned the result to such a variable) -- Regards, Tom Ogilvy "dan" wrote: I'm trying to find a way to have VBA give me the sum of multiple non-integers to the 2nd decimal place. So far, I'm having no luck. I thought formatting the variable using "#,###.##" might work, but for the sum of 1.5 & 1 it gives me 2. (It doesn't give me 2.00, just 2. with a lone decimal place after the 2) What can I do to get VBA to recognize the decimal places? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
telling range when to stop. | Excel Programming | |||
Telling a website what to do!! | Excel Programming | |||
Telling a procedure to end | Excel Programming | |||
Telling MSGraph which cell I need | Excel Programming | |||
telling Excel to go down relatively | Excel Programming |