Thread
:
Simple VBA Accumulator (Function?)
View Single Post
#
2
Posted to microsoft.public.excel.programming
Don Guillett
external usenet poster
Posts: 10,124
Simple VBA Accumulator (Function?)
Does this simple macro help. If not, details.
Sub addto()
var1 = 2
var2 = 3
MsgBox var1 + var2 '5
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
wrote in message
...
Can a function get repeated values, add them, and return a total to
the calling procedure?
I need to reuse this code with differing numbers of items.
Example
Pass these parameters
add_to(1)
add_to(2)
Get the returned total from function
function accum(number)
total = total + number
RETURN TOTAL to Procedure
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett