Sub theBatchPrint() Dim arr As Variant, theFinalRow&, theStr$, i&, j&, brr() As Variant theFinalRow = Cells(Rows.Count, 10).End(xlUp).Row arr = Range(Cells(2, 10), Cells(theFinalRow, 14)) ReDim brr(1 To 1, 1 To UBound(arr, 2)) For i = 2 To UBound(arr) theStr = arr(i, 1) If theStr <> "" Then For j = 1 To 5 brr(1, j) = arr(i, j) Next j End If Cells(2, 1).Resize(, 5) = brr ActiveSheet.PrintPreview '实际使用时用ActiveSheet.PrintOut DoEvents Next i End Sub Sub theSpaceBarPrint() Dim arr As Variant, theFinalRow&, theStr$, i&, j&, brr() As Variant theFinalRow = Cells(Rows.Count, 10).End(xlUp).Row arr = Range(Cells(2, 10), Cells(theFinalRow, 14)) ReDim brr(1 To 1, 1 To UBound(arr, 2)) For i = 2 To UBound(arr) theStr = arr(i, 1) If theStr <> "" Then For j = 1 To 5 brr(1, j) = arr(i, j) Next j End If Cells(2, 1).Resize(, 5) = brr MsgBox "请按空格键继续打印……", vbOKOnly, "确认打印" ActiveSheet.PrintPreview '实际使用时用ActiveSheet.PrintOut DoEvents Next i End Sub |