我正在.xlsm
使用 Visual Basic (VBA) 将工作表导出为 PDF。我只想导出列A:Z
。
我试过这个:
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws.PageSetup
.PrintArea = "$A:$Z"
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.Orientation = xlLandscape
.PaperSize = xlPaperA3
.RightMargin = Application.InchesToPoints(0.25)
End With
Next
ThisWorkbook.Sheets("Diagram").Select
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=strFilename, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=True, _
OpenAfterPublish:=False
但是我在右侧得到了空间,就像它填满了整个页面一样,只是隐藏了我没有选择的列......
有什么办法可以解决这个问题并使列A:Z
填满整个页面?
任何帮助是极大的赞赏 :)