- Private Sub CommandButton1_Click()
- Dim i%, arr
- arr = Application.InputBox("选择区域", Type:=8)
- t1 = UBound(arr)
- t2 = UBound(arr, 2)
- ReDim brr(1 To t1 * t2, 1 To 6)
- For i = 2 To t1
- m = 4
- For k = i To i + t2 - 5
- n = n + 1
- m = m + 1
- brr(n, 1) = arr(i, 1)
- brr(n, 2) = arr(i, 2)
- brr(n, 3) = arr(i, 3)
- brr(n, 4) = arr(i, 4)
- brr(n, 5) = arr(1, m)
- brr(n, 6) = arr(i, m)
- Next k
- Next i
- tishi = Application.InputBox("选择存放起始单元格", Type:=8).Address(0, 0)
- Range(tishi).Offset(1, 0).Resize(UBound(brr), 6) = brr
- End Sub
复制代码
|