Gemandshed
New Member
- Joined
- Apr 5, 2023
- Messages
- 15
- Office Version
- 2010
Hi.
I’m using the following VBA to convert all my worksheets to PDF.
However I want to change the file name to include additional text (worksheet name and “_QTR12024”
Where do I add this in the below to get this result?
Assuming it’s in the file name bit but I’ve got a hundred tabs so don’t want to get it wrong.
Thank you in advance
Sub SaveAsPDF()
Dim CurWorksheet As Worksheet
For Each CurWorksheet In ActiveWorkbook.Worksheets
CurWorksheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=Application.ActiveWorkbook.Path & “\” & CurWorksheet.Name, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Next CurWorksheet
End Sub
Regards
I’m using the following VBA to convert all my worksheets to PDF.
However I want to change the file name to include additional text (worksheet name and “_QTR12024”
Where do I add this in the below to get this result?
Assuming it’s in the file name bit but I’ve got a hundred tabs so don’t want to get it wrong.
Thank you in advance
Sub SaveAsPDF()
Dim CurWorksheet As Worksheet
For Each CurWorksheet In ActiveWorkbook.Worksheets
CurWorksheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=Application.ActiveWorkbook.Path & “\” & CurWorksheet.Name, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Next CurWorksheet
End Sub
Regards