По Chip Pearson's examples Вы можете передать массив в качестве параметра
Function SumArray(Arr() As Long) As Long
'''''''''''''''''''''''''''''''''''''''''''
' SumArray
' This sums the elements of Arr and returns
' the total.
'''''''''''''''''''''''''''''''''''''''''''
Dim N As Long
Dim Total As Long
For N = LBound(Arr) To UBound(Arr)
Total = Total + Arr(N)
Next N
SumArray = Total
End Function
также возвращает массив в качестве результата функции, например.
Function LoadNumbers(Low As Long, High As Long) As Long()
'''''''''''''''''''''''''''''''''''''''
' Returns an array of Longs, containing
' the numbers from Low to High. The
' number of elements in the returned
' array will vary depending on the
' values of Low and High.
''''''''''''''''''''''''''''''''''''''''
Dim ResultArray() As Long
Dim Ndx As Long
Dim Val As Long
'''''''''''''''''''''''''''''''''''''''''
' Ensure Low <= High
'''''''''''''''''''''''''''''''''''''''''
If Low > High Then
Exit Function
End If
'''''''''''''''''''''''''''''''''''''''''
' Resize the array
'''''''''''''''''''''''''''''''''''''''''
ReDim ResultArray(1 To (High - Low + 1))
''''''''''''''''''''''''''''''''''''''''
' Fill the array with values.
''''''''''''''''''''''''''''''''''''''''
Val = Low
For Ndx = LBound(ResultArray) To UBound(ResultArray)
ResultArray(Ndx) = Val
Val = Val + 1
Next Ndx
LoadNumbers = ResultArray()
End Function
Далее информация/примеры www.cpearson.com
[Как: передать массив в процедуре] (https://msdn.microsoft.com/en-us/library/vstudio/63y5ksfs%28v= vs.100% 29.aspx? f = 255 & MSPPError = -2147217396) – 0m3r
@Omar хорошая ссылка, но не совсем VBA –