使用VBA设置打印页面高度和宽度

使用VBA设置打印页面高度和宽度(一般需要设置在一页纸的时候)

 

 

1 Sub Setprintpage() '设置打印页面为缩放到一页
2     Application.PrintCommunication = False '关掉打印通讯
3     With ActiveSheet.PageSetup
4         .Zoom = True
5         .FitToPagesWide = 1
6         .FitToPagesTall = 1
7     End With
8     Application.PrintCommunication = True '恢复打印通讯
9 End Sub

 

posted @ 2020-06-24 10:25  柳稻菲  阅读(1516)  评论(0编辑  收藏  举报