2016-11-09 108 views
1

当通过宏打印时,有没有一种方法可以控制PDF上的缩放比例?我放大了电子表格中的100%,但PDF总是显示为79.3%,而且很难看清楚。如果以200%放大,它在PDF上显示得非常好。我通常会忽略这方面,只是告诉用户放大,但它是为首席执行官,你知道。Excel VBA输出为PDF缩放%

以下是我有:

Private Sub CommandButton1_Click() 
Dim Sel_Manager As String 
'Specify headers to be repeated at the top 
Application.PrintCommunication = False 
With ActiveSheet.PageSetup 
     .PrintTitleRows = "$5:$10" 
     .PrintTitleColumns = "$B:$M" 
     .Orientation = xlLandscape 
     .Zoom = False 
     .FitToPagesWide = 1 
     .FitToPagesTall = 1 
End With 

'Manager selection through simple Inputbox 
Sel_Manager = ComboBox1 
'Insert autofilter for worksheet 
Cells.Select 
Selection.AutoFilter 
'Select manager defined in inputbox 
ActiveSheet.Range("B10", Range("M10").End(xlDown)).AutoFilter Field:=1, Criteria1:=Sel_Manager 
ActiveSheet.Range("B10", Range("M10").End(xlDown)).AutoFilter Field:=2, Criteria1:="A" 
'Select range to be printed and specify manager in filename 
ActiveSheet.Range("B10", Range("M10").End(xlDown)).Select 

Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ 
Sel_Manager + ".pdf", Quality:=xlQualityStandard, _ 
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True 

ActiveSheet.ShowAllData 
Application.PrintCommunication = True 
End Sub 

回答

1

之前结束子,可你的行添加到您的代码,请。

Application.PrintCommunication = False 
    With ActiveSheet.PageSetup 
     .Orientation = xlLandscape 
     .Zoom = False 
     '.PrintArea = Worksheets(ReportWsName).UsedRange 
     .FitToPagesWide = 1 
     '.FitToPagesTall = 1 
    End With 
Application.PrintCommunication = True 
+0

对于打印区域,它会根据自动过滤器自动调整,我将如何调整它?感谢您的帮助! –