|
参与一下。。。
- Sub ykcbf() '//2024.7.24
- Application.ScreenUpdating = False
- Set sh = ThisWorkbook.Sheets("Sheet0")
- With sh
- r = .Cells(Rows.Count, 1).End(3).Row
- c = .Range("XFD1").End(1).Column
- arr = .[a1].Resize(r, c)
- End With
- On Error Resume Next
- For j = 6 To UBound(arr, 2)
- n = n + 1
- ReDim brr(1 To UBound(arr), 1 To 4)
- m = 0
- For i = 1 To UBound(arr)
- m = m + 1
- brr(m, 1) = arr(i, 1)
- brr(m, 2) = arr(i, 2)
- brr(m, 3) = arr(i, j)
- brr(m, 4) = arr(i, 4)
- Next
- With Sheets("Sheet" & n)
- .UsedRange.ClearContents
- .[a1].Resize(m, 4) = brr
- End With
- Next
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|