```
Function MergeArrays(firstArray As Variant, secondArray As Variant, _
resultArray As Variant) As Boolean
Dim NumElements1 As Long, NumElements2 As Long, Ndx As Long, Cntr As Long
MergeArrays = False
If Not IsArray(firstArray) Then Exit Function
If Not IsArray(secondArray) Then Exit Function
' to be more robust here you could test that
' the first two arrays are allocated and are 2 dimensional
' i'll leave this out though, resultArray needs to be dynamic as well
NumElements1 = UBound(firstArray, 1) - LBound(firstArray, 1) + 1
NumElements2 = UBound(secondArray, 1) - LBound(secondArray, 1) + 1
ReDim resultArray(1 To NumElements1 + NumElements2, 1 To 2)
Cntr = 1
For Ndx = LBound(firstArray, 1) To UBound(firstArray, 1)
resultArray(Cntr, 1) = firstArray(Ndx, 1)
resultArray(Cntr, 2) = firstArray(Ndx, 2)
Cntr = Cntr + 1
Next Ndx
For Ndx = LBound(secondArray, 1) To UBound(secondArray, 1)
resultArray(Cntr, 1) = secondArray(Ndx, 1)
resultArray(Cntr, 2) = secondArray(Ndx, 2)
Cntr = Cntr + 1
Next Ndx
MergeArrays = True
End Function
```