Peter Muller
Board Regular
- Joined
- Oct 15, 2018
- Messages
- 133
- Office Version
- 365
- Platform
- Windows
Good afternoon,
I save every page to the right of “Reports” to a PDF file.
I have the following code which you assisted me with before, but it was to save each page individually. I now want to save all the pages to PDF at the same time. Please assist.
'To print sheet and save to PDF
Dim sht_nm As String
Dim dt As String
sht_nm = ActiveSheet.Name
dt = Format(Now(), " DD-MMM-YY")
'Save PDF Report to Folder
.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\Peter\Desktop\Finance\PDF Reports\" & sht_nm & dt & ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
I have this code to print each sheet to the right of “Reports” which I have tried to marry to the above code but cannot get it to work. Please help
PrintSheets()
Dim idx, i As Long
idx = Sheets("Reports").Index + 1
For i = idx To Sheets.Count
Sheets(i).PrintOut
Next
I save every page to the right of “Reports” to a PDF file.
I have the following code which you assisted me with before, but it was to save each page individually. I now want to save all the pages to PDF at the same time. Please assist.
'To print sheet and save to PDF
Dim sht_nm As String
Dim dt As String
sht_nm = ActiveSheet.Name
dt = Format(Now(), " DD-MMM-YY")
'Save PDF Report to Folder
.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\Peter\Desktop\Finance\PDF Reports\" & sht_nm & dt & ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
I have this code to print each sheet to the right of “Reports” which I have tried to marry to the above code but cannot get it to work. Please help
PrintSheets()
Dim idx, i As Long
idx = Sheets("Reports").Index + 1
For i = idx To Sheets.Count
Sheets(i).PrintOut
Next