Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I wish to add up certain values in a variant array (has to be variant, as
data is mixed), to make sure total of these values does not exceed 100. I thought I could simply assign these array values to integer variables and that would work, but it concatenates the numbers (12 + 4 = 124, for instance) instead of adding them. Any ideas how to do this? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use
dim intAaccumulator as integer 'place this inside your loop to traverse the array if isnumeric(array(counter).value) and instr(".", array(counter).value) = 0 then intAccumulator = intAccumulator + (CInt(array(counter).value) end if "Graham McNeill" wrote: I wish to add up certain values in a variant array (has to be variant, as data is mixed), to make sure total of these values does not exceed 100. I thought I could simply assign these array values to integer variables and that would work, but it concatenates the numbers (12 + 4 = 124, for instance) instead of adding them. Any ideas how to do this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
To get a sum for variant currency values | Excel Discussion (Misc queries) | |||
how do I put in the IF function only integer as true values? | Excel Worksheet Functions | |||
Variant Array with String Values - Type Mismatch | Excel Programming | |||
variant array containing cel adresses convert to actual ranges-array | Excel Programming |