VBA Excel 打印

1. 设置 页边距、打印区域

With .PageSetup
  .HeaderMargin = Application.CentimetersToPoints(0.5)
  .LeftMargin = Application.CentimetersToPoints(1.5)
  .RightMargin = Application.CentimetersToPoints(1)
  .TopMargin = Application.CentimetersToPoints(1)
  .BottomMargin = Application.CentimetersToPoints(1)
  .FooterMargin = Application.CentimetersToPoints(0.5)

  .PrintTitleRows = "$1:$3" '要打印的默认页头
  .printArea = "A4:M" & l + 1 '打印区域
End With


2. 执行打印

.Sheets("dl_1").PrintOut Copies:=2 '打印(2份)


 

 

posted @ 2014-06-21 15:14  ssfie  阅读(958)  评论(0编辑  收藏  举报