文章预览
学习Excel技术,关注微信公众号: excelperfect 标签: VBA 需要使用 VBA 代码来设置个人工作簿中所有工作表的打印选项:缩小边距、横向和 A3 纸。 VBA 代码如下: Private Sub PrintSetup() Dim ws As Worksheet 'For Each ws In ThisWorkbook.Worksheets ‘对于工作簿 For Each ws In Application.Worksheets ‘对于个人工作簿 With ws.PageSetup .LeftMargin = Application.InchesToPoints(0.25) .RightMargin = Application.InchesToPoints(0.25) .TopMargin = Application.InchesToPoints(0.75) .BottomMargin = Application.InchesToPoints(0.75) .HeaderMargin = Application.InchesToPoints(0.3) .FooterMargin = Application.InchesToPoints(0.3) .Orientation = xlLandscape .PaperSize = xlPaperA3 .Zoom = 100 End With Application.PrintCommunication = True Next ws End Sub 代码很简短。 实际上,可以将打
………………………………