Split all worksheets into individual PDF

  • Hi all,



    I am trying to change location of the pdfs to different folder location instead of desktop. I do have hidden tabs.


    Any help is much appreciated.



    Code
    1. Sub Save_As_PDF_To_Desktop_4()
    2. Dim sh As Worksheet
    3. For Each sh In ActiveWorkbook.Worksheets
    4. If sh.Name <> "Instructions" And sh.Visible = True Then sh.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    5. CreateObject("WScript.Shell").specialfolders("Desktop") & "\" & sh.Name & ".pdf" _
    6. , Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
    7. :=False, OpenAfterPublish:=False
    8. Next sh
    9. End Sub
  • Try


    Code
    1. Sub Save_As_PDF_To_Desktop_4()
    2. Dim sh As Worksheet
    3. For Each sh In ActiveWorkbook.Worksheets
    4. If sh.Name <> "Instructions" And sh.Visible = True Then sh.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    5. "C:\PDF Saved Files\" & sh.Name & ".pdf" _
    6. , Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
    7. :=False, OpenAfterPublish:=False
    8. Next sh
    9. End Sub


    Change

    Code
    1. C:\PDF Saved Files

    to the folder name where you want the PDF files saved into.

  • Select the Folder to save into.

  • We want to make sure you have something to think about this coming weekend.

    Code
    1. Sub Or_Simply()
    2. Dim sh As Worksheet
    3. Application.ScreenUpdating = False
    4. For Each sh In ActiveWorkbook.Worksheets
    5. If sh.Name <> "Instructions" And sh.Visible = True Then
    6. sh.PrintOut , , , , , True, , "C:\PDF Folder\" & sh.Name & ".PDF" '<---- Change as required
    7. End If
    8. Next sh
    9. Application.ScreenUpdating = True
    10. End Sub
  • We want to make sure you have something to think about this coming weekend.

    Code
    1. Sub Or_Simply()
    2. Dim sh As Worksheet
    3. Application.ScreenUpdating = False
    4. For Each sh In ActiveWorkbook.Worksheets
    5. If sh.Name <> "Instructions" And sh.Visible = True Then
    6. sh.PrintOut , , , , , True, , "C:\PDF Folder\" & sh.Name & ".PDF" '<---- Change as required
    7. End If
    8. Next sh
    9. Application.ScreenUpdating = True
    10. End Sub

    lol, thank you very much for all your help. This is extremely helpful.


    Thanks.