How do you sum an array?
Let's say I have a single dimensional array with three elements. Each element is an integer. How do I add each element togther, within the array, to come up with a total?
Element 0 = 10.00
Element 1 = 20.10
Element 2 = 30.40
I need to tally these up so the total will equal 60.50.
Re: How do you sum an array?
I had forgotten to mention that those integers are currency.
I asked another automator on our floor and he gave me the code. I then tweaked it a bit and it works.
The array is called "arrAcctBal" and I got the values placed in it earlier in the code. The code snipet here is just to show how to add each element within the array and then convert them to currency.
varSum = 0
For x = 0 to Ubound(arrAcctBal)
varSum = CDbl(varSum) + CDBL(arrAcctBal(x))
FundBalWEB = (FormatCurrency(Cdbl(varSum)))