使用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
原文地址:https://www.cnblogs.com/ty1216jhy/p/13186202.html