|
- Sub test()
- Dim r%, i%
- Dim arr, brr
- With Worksheets("导入数据")
- r = .Cells(.Rows.Count, 1).End(xlUp).Row
- arr = .Range("a2:m" & r)
- ReDim brr(1 To UBound(arr) * 10, 1 To UBound(arr, 2))
- m = 0
- For i = 1 To UBound(arr)
- crr = Split(arr(i, 11), " ")
- drr = Split(arr(i, 12), " ")
- frr = Split(arr(i, 13), " ")
- For j = 0 To UBound(crr)
- m = m + 1
- For k = 1 To 10
- brr(m, k) = arr(i, k)
- Next
- brr(m, 11) = crr(j)
- brr(m, 12) = drr(j)
- brr(m, 13) = frr(j)
- Next
- Next
- End With
- With Worksheets("执行结果")
- .Range("a2").Resize(m, UBound(brr, 2)) = brr
- End With
- End Sub
复制代码 |
|