|
- Sub 连续打印()
- Dim m%, n%, i%
- Dim arr
- If MsgBox("确定打印吗?", vbYesNo + vbInformation, "友情提醒:") = vbYes Then
- arr = Worksheets("原始数据").Range("A1").CurrentRegion
- m = Range("O1").Value
- n = Range("O2").Value
- Application.ScreenUpdating = False
- With ActiveSheet
- For i = m To n
- .Range("G2") = arr(m, 1)
- .Range("B4") = arr(1, 2)
- .Range("L4") = arr(1, 4)
- .Range("B5") = arr(m, 3)
- Union(.Range("B9"), .Range("E9"), .Range("H9")) = arr(m, 4)
- Union(.Range("C9"), .Range("F9"), .Range("I9")) = arr(m, 5)
- Union(.Range("D9"), .Range("G9"), .Range("J9"), .Range("L9")) = arr(m, 6)
- .Range("B10") = arr(m, 2)
- .PrintOut
- Next
- End With
- Application.ScreenUpdating = True
- MsgBox "打印完毕!", vbOKOnly + vbInformation, "友情提醒:"
- End If
- End Sub
复制代码 |
|