在现在物流快递业务越来越多,填写快递单是一个非常痛苦的事。同时快递业务也需要记录跟踪,在现实工作中我们常常会用excel进行记录跟踪。有了excel我们就想到用excel的编程功能实现连续打印快递单,具体步骤如下:
1、根据快递单幅面,在excel里增加一个sheet,并制定好excel的同版面的格式,这个工作非常需要耐心(sheet命名为:快递单);
2、在本机上安装针式打印机,并自己定好特定纸张(按照快递的大小设置好自定义纸张),并设置好打印机的默认纸张;
3、填写excel的通讯页,根据快递单的需要填写的内容,准备好内容(sheet命名为:通讯地址);
4、编写宏代码如下:
Sub PrintToPrint()
Dim i As Integer, j As Integer
Dim wsh As Worksheet
Set wsh = Application.Worksheets("快递单")
'remove all page breaks
wsh.ResetAllPageBreaks
'enable autoajusting
wsh.PageSetup.Zoom = False
'set new area
wsh.PageSetup.PrintArea = "A2:K11"
'set paper orientation
wsh.PageSetup.Orientation