|
- Sub batchPrint()
- Dim r, tb As Integer
- Dim arrRef As Variant
- With Sheets("磅单数据")
- r = .Cells(Rows.Count, 1).End(xlUp).Row
- arrRef = Range(.Cells(2, 1), .Cells(r, 10))
- End With
-
- For tb = 1 To UBound(arrRef)
- Range("C3") = arrRef(tb, 1) '收货单位
- Range("G3") = arrRef(tb, 2) '日期
- Range("C4") = arrRef(tb, 3) '发货地址
- Range("F4") = arrRef(tb, 4) '收货地址
- Range("C5") = arrRef(tb, 5) '货物名称
- Range("E5") = arrRef(tb, 6) '承运车号
- Range("C6") = arrRef(tb, 7) '毛重
- Range("E6") = arrRef(tb, 8) '皮重
- Range("G6") = arrRef(tb, 9) '净重
- Range("C7") = arrRef(tb, 10) '运费单价
- ActiveSheet.PrintOut '打印表单
- Next
-
- End Sub
复制代码 |
|