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

posted on 2015-07-10 11:03  Mr.耳东  阅读(2252)  评论(0编辑  收藏  举报