将范围合并为PDF

时间:2015-01-14 17:59:43

标签: excel vba pdf union

我想结合我定义的两个范围并将其保存为pdf。到目前为止,我有这个:

Sub SaveAsPDF3()
'
' SaveAsPDF Macro
'
Dim pdfpath As String
Dim RP_Sum As Integer
Dim RP_Sum_Tot As Integer
Dim Summary As Range
Dim Critera As Range
Dim Summary_with_Criteria As Range
Set Criteria = Range("Criteria")
Set Summary = Range("Summary")


ActiveSheet.PageSetup.Orientation = xlLandscape
pdfpath = Range("Ind_RP_Pdf")

RP_Sum = Application.WorksheetFunction.CountA(Sheets("Reports").Range("A10:A100"))
MsgBox (RP_Sum)
RP_Sum_Tot = 8 + RP_Sum + 2
'MsgBox (RP_Sum_Tot)
    Range(Cells(8, 1), Cells(RP_Sum_Tot, 11)).Name = "Summary"
Set Summary_with_Criteria = Application.Union(Summary, Criteria)

Range("Summary_with_Criteria").ExportAsFixedFormat _
    Type:=xlTypePDF, _
    Filename:=pdfpath, _
    Quality:=xlQualityStandard, _
    IncludeDocProperties:=True, _
    IgnorePrintAreas:=False, _
    OpenAfterPublish:=False

Range("Report_Learner").Select
End Sub

我在ExprotAsFixedformat行上出现错误

有什么建议吗? 感谢

0 个答案:

没有答案