Short answer is yes. Try this example:If I call "sub_A" from within "sub_B", and "sub_A" fills an array, what's the best way to get that array back over to "sub_B" without making it public?
Sub A()
Dim myArr(1 To 10)
For i = 1 To 10
myArr(i) = 1
Next i
Call B(myArr)
End Sub
Sub B(vArr() As Variant)
For j = LBound(vArr) To UBound(vArr)
vArr(j) = 2 * vArr(j)
Next j
ActiveSheet.Range("A1").Resize(1, UBound(vArr)).Value = vArr
End Sub
Public Static Sub test()
For Each element In test2
MsgBox test2(element)
Next
End Sub
Private Function test2()
Dim a()
For b = 1 To 2
ReDim Preserve a(1 To b)
a(b) = b
Next
test2 = a()
End Function
Public Static Sub test()
Dim b()
b() = test2
For Each element In b()
MsgBox b(element)
Next
End Sub
Private Function test2()
Dim a()
For b = 1 To 2
ReDim Preserve a(1 To b)
a(b) = b
Next
test2 = a()
End Function