The following lines were added (+) and removed (-):
Option Explicit Option Explicit Call RoutineA(varArray) Private Sub RoutineA(ByRef intArray() As Integer) Dim obj As Variant For Each obj In intArray Form1.txtOut.text = Form1.txtOut.text & vbCrLf & obj Next End Sub === pass an Array back to the calling procedure === Private Function ReturnArray() As Variant Dim MyArray(3) As Integer 'Declare a Static Integer Array of 4 elements MyArray(0) = 1 MyArray(1) = 2 MyArray(2) = 3 MyArray(3) = 4 ReturnArray = MyArray 'Pass the array back as a return value End Function Accept an Array as an argument. Private Sub cmdReturnArray_Click() Dim retval As Variant Dim obj retval = ReturnArray 'Assign the return value to a Variant Variable For Each obj In retval Form1.Print obj Next End Sub