|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Option Explicit
Sub TEST1()
Dim ar(1 To 2), br, i&, j&, r&, k&, m&, n&
m = 1
For i = 1 To 2
ar(i) = Cells(1, (i - 1) * 4 + 1).CurrentRegion.Value
m = m * UBound(ar(i)): n = n + UBound(ar(i), 2)
Next i
ReDim br(1 To m, 1 To n)
For i = 1 To UBound(ar(1))
For j = 1 To UBound(ar(2))
r = r + 1
n = 0
For k = 1 To UBound(ar(1), 1)
n = n + 1
br(r, n) = ar(1)(i, k)
Next k
For k = 1 To UBound(ar(2), 1)
n = n + 1
br(r, n) = ar(2)(j, k)
Next k
Next j
Next i
[J1].Resize(UBound(br), UBound(br, 2)) = br
Beep
End Sub
|
评分
-
2
查看全部评分
-
|