Passing an array to a Sub or Function
How do I pass an array to a Sub or Function?
Lets say I have a single dimensional array with from 0 to 10.
When passing to an array to a sub do I have to specify the array number as in the example below?
Call OtherSubRoutine(strArray(9))
or
Call OtherSubRoutine(strArray())
will the second option pass all values or give me an error?
and how do I receive in the sub that is being called?
example:
Sub OtherSubRoutine(strArray(9) As String)
or
Sub OtherSubRoutine(strArray() As String)
or
Sub OtherSubRoutine(ReDim Preserve strArray() As String)
I'm confused. What to do? Please advise...
Thanks,
Don
|