|
本帖最后由 xiakor 于 2024-11-2 14:50 编辑
看看下面代码是否需要的?
- Sub test()
- Dim ws As Worksheet
- Dim r As Integer
- Dim i As Integer
- Dim R1 As Range
- Dim R2 As Range
- Application.ScreenUpdating = False
- Set ws = Sheets("千遍模拟数据")
- r = 3
- For i = 1 To 1000
- With Sheets("数据")
- Set R1 = .Range("T5:V20")
- Set R2 = .Range("T29:V44")
- R1.Copy
- ws.Cells(r, "B").PasteSpecial Paste:=-4163
- ws.Cells(r, "B").PasteSpecial Paste:=-4122
- R2.Copy
- ws.Cells(r, "E").PasteSpecial Paste:=-4163
- ws.Cells(r, "E").PasteSpecial Paste:=-4122
- End With
- Application.CutCopyMode = False
- r = r + 16
- Next i
- Application.ScreenUpdating = True
- MsgBox "ok!"
- End Sub
复制代码 |
|