老师 我在您的代码上做了一点改动,
我调试了一下,可以使用
Sub ykcbf()
Application.ScreenUpdating = False
arr = Sheets("Date").UsedRange.Offset(1).Value
Sheets("模板").Cells.Copy Sheets("打印").[a1]
With Sheets("打印")
For i = 1 To UBound(arr) Step 3
m = m + 1
For j = 1 To 3
x = (m - 1) * 8 + 1
y = (j - 1) * 4 + 1
.Cells(x + 1, y + 1) = "'" & arr(i + j - 1, 1)
.Cells(x + 2, y + 1) = arr(i + j - 1, 2)
.Cells(x + 3, y + 1) = arr(i + j - 1, 3)
.Cells(x + 4, y + 1) = arr(i + j - 1, 5)
.Cells(x + 4, y + 2) = arr(i + j - 1, 4)
.Cells(x + 5, y + 1) = arr(i + j - 1, 6)
.Cells(x + 6, y + 1) = arr(i + j - 1, 7)
Next
Next
End With
Application.ScreenUpdating = True
MsgBox "OK!"
End Sub