VBA中一个过程或函数返回多个值(数组地址)

获得macro1中的数组

Sub xx()
Dim s() As Integer
macro1 5, s
MsgBox s(0) & vbCrLf & s(1)
End Sub


Sub macro1(ByVal x As Integer, ByRef sa() As Integer)
ReDim sa(1)

x = 1

sa(0) = x + x
sa(1) = x * x
End Sub

原文地址:https://www.cnblogs.com/Mrerdong/p/4635171.html