I need to call the same sub, several times, with several different arrays as an argument each time. Call the arrays First(), Second(), ... . I am trying to avoid writing:
Call MySub(First())
Call MySub(Second())
over and over. So I try to stick my arguments in an array:
Dim v as Variant
v = Array(First(), Second(), ...)
And I can loop through v to call the MySub with each argument.
But now I discover that v does not pass each array ByRef, it only passes ByVal--it makes copies and the originals, which I need the MySub to change for later use, never get changed (only copies of them get changed).
Is there a simple way to do this? To tidy up? I think I could create a Collection of my array arguments--but I can't add them as a list all at once can I? So I would then need 20 Add statements to fill my collection and I've only made more of a mess...
Ideas? Thanks.
Call MySub(First())
Call MySub(Second())
over and over. So I try to stick my arguments in an array:
Dim v as Variant
v = Array(First(), Second(), ...)
And I can loop through v to call the MySub with each argument.
But now I discover that v does not pass each array ByRef, it only passes ByVal--it makes copies and the originals, which I need the MySub to change for later use, never get changed (only copies of them get changed).
Is there a simple way to do this? To tidy up? I think I could create a Collection of my array arguments--but I can't add them as a list all at once can I? So I would then need 20 Add statements to fill my collection and I've only made more of a mess...
Ideas? Thanks.