T
Tom Ogilvy
Sub combinearrays()
Dim tab1, tab2, tab3
Dim lb1 As Long, lb2 As Long
Dim ub1 As Long, ub2 As Long
Dim n As Long, n1 As Long
Dim i As Long, s As String
tab1 = Array(1, 2, 3, 4)
tab2 = Array(1, 2, 5, 6, 7, 8, 9, 10, 11, 12)
lb1 = LBound(tab1)
ub1 = UBound(tab1)
lb2 = LBound(tab2)
ub2 = UBound(tab2)
n = ub1 - lb1 + 1 + ub2 - lb2 + 1
ReDim tab3(1 To n)
n1 = 0
For i = lb1 To ub1
n1 = n1 + 1
tab3(n1) = tab1(i)
s = s & tab3(n1) & ","
Next
For i = lb2 To ub2
n1 = n1 + 1
tab3(n1) = tab2(i)
s = s & tab3(n1) & ","
Next
Debug.Print UBound(tab3) - LBound(tab3) + 1
Debug.Print Left(s, Len(s) - 1)
End Sub
Dim tab1, tab2, tab3
Dim lb1 As Long, lb2 As Long
Dim ub1 As Long, ub2 As Long
Dim n As Long, n1 As Long
Dim i As Long, s As String
tab1 = Array(1, 2, 3, 4)
tab2 = Array(1, 2, 5, 6, 7, 8, 9, 10, 11, 12)
lb1 = LBound(tab1)
ub1 = UBound(tab1)
lb2 = LBound(tab2)
ub2 = UBound(tab2)
n = ub1 - lb1 + 1 + ub2 - lb2 + 1
ReDim tab3(1 To n)
n1 = 0
For i = lb1 To ub1
n1 = n1 + 1
tab3(n1) = tab1(i)
s = s & tab3(n1) & ","
Next
For i = lb2 To ub2
n1 = n1 + 1
tab3(n1) = tab2(i)
s = s & tab3(n1) & ","
Next
Debug.Print UBound(tab3) - LBound(tab3) + 1
Debug.Print Left(s, Len(s) - 1)
End Sub