Sub test()
ReDim arr(1 To 10000, 1 To 4)
brr = Sheet1.[a1].CurrentRegion
For i = 2 To UBound(brr)
If Len(brr(i, 5)) Then
For s = 1 To brr(i, 5)
n = n + 1
For j = 1 To UBound(brr, 2) - 1
arr(n, j) = brr(i, j)
Next j
Next s
End If
Next i
Sheet2.[a1].CurrentRegion.Offset(1).ClearContents
Sheet2.[a2].Resize(n, 4) = arr
End Sub作者: Hsieh 時間: 2018-10-2 09:09