如果要将多个范围保存为 PDF,则可以尝试以下代码:
Sub CreateMultiRangeOnePagePDF()
Dim RangeArray() As Variant
Dim x As Long, LR As Long
Const RngPad As Long = 2 'set to number of rows between ranges
RangeArray = Array("Sheet1!A1:D30", "Sheet1!E1:H30", "Sheet1!I1:L30")
Application.ScreenUpdating = False
Sheets.Add After:=Sheets(Sheets.Count)
For x = 0 To UBound(RangeArray)
LR = Sheets(Sheets.Count).Cells(Rows.Count, 1).End(xlUp).Row
If LR <> 1 Then LR = LR + 1 + RngPad
Range(RangeArray(x)).Copy
Sheets(Sheets.Count).Cells(LR, 1).PasteSpecial Paste:=xlPasteValues
Selection.PasteSpecial Paste:=xlPasteFormats
Application.CutCopyMode = False
Next x
Sheets(Sheets.Count).ExportAsFixedFormat Type:=xlTypePDF, _
Filename:="Z:\Test.pdf", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Application.DisplayAlerts = False
Sheets(Sheets.Count).Delete
Application.DisplayAlerts = True
End Sub