|
参与一下。。。- Sub ykcbf() '//2024.3.21
- arr = Sheets("Sheet1").UsedRange
- ReDim brr(1 To UBound(arr) * 10, 1 To 6)
- For i = 2 To UBound(arr)
- m = m + 1
- For j = 1 To 6
- brr(m, j) = arr(i, j)
- Next
- For j = 7 To UBound(arr, 2) Step 3
- If arr(i, j) <> Empty Then
- m = m + 1
- brr(m, 2) = arr(i, j)
- brr(m, 3) = arr(i, j + 1)
- brr(m, 4) = arr(i, j + 2)
- brr(m, 5) = brr(m - 1, 5)
- brr(m, 6) = brr(m - 1, 6)
- End If
- Next
- Next
- With Sheets("Sheet2")
- .UsedRange.Offset(1) = ""
- .[a2].Resize(m, 6) = brr
- End With
- MsgBox "OK!"
- End Sub
复制代码
|
|