Hoping someone can help as I'm about to lose my mind!
I am very much a rookie at this and do not understand VBA at all.
I have entered the below to save as each worksheet as a PDF.
I also need to ensure the PDF are saved in the same folder as the original excel file.
At the moment the PDF work and save to the documents folder.
WHO CAN HELP??
Private Sub CommandButton1_Click()
Dim ws As Worksheet
Dim Fname As String
For Each ws In ActiveWorkbook.Worksheets
On Error Resume Next 'Continue if an error occurs
Fname = ws.Name
ws.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=Fname, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False
Next ws
End Sub
I am very much a rookie at this and do not understand VBA at all.
I have entered the below to save as each worksheet as a PDF.
I also need to ensure the PDF are saved in the same folder as the original excel file.
At the moment the PDF work and save to the documents folder.
WHO CAN HELP??
Private Sub CommandButton1_Click()
Dim ws As Worksheet
Dim Fname As String
For Each ws In ActiveWorkbook.Worksheets
On Error Resume Next 'Continue if an error occurs
Fname = ws.Name
ws.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=Fname, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False
Next ws
End Sub