Hi guys,
I want to print several sheets of my Excel file to a PDF but I don't want the name of the PDF saved to be the same as the worksheet's name. Below you can see the VBA code I am using right now. As you can see the name isn't changed which I tried with other syntax of VBA but can't get it to work.
If you can help me out that would be great,
Tnx
--------
Private Sub CommandButton3_Click()
Dim FolderPath As String
Dim I As Integer
FolderPath = "X"
For I = 16 To 24
Worksheets(I).ExportAsFixedFormat Type:=xlTypePDF, Filename:=FolderPath & "\" & _
Worksheets(I).Name, OpenAfterPublish:=False
Next
MsgBox "All PDF's have been successfully exported."
End Sub
--------
Bookmarks