Creating Individual PDFs by Worksheet

Written by Allen Wyatt (last updated July 27, 2024)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


Lissa has a workbook that contains multiple worksheets. She would like to create individual PDFs for these worksheets (one PDF per worksheet) with the name of the PDF based on the worksheet's name. She wonders if there is a way to do this in Excel.

There are ways to do it, depending on how much time you want to spend. If this is a "one off" occurrence, you might consider just printing each individual worksheet manually. Or, you could copy each worksheet to its own workbook and then print each workbook to PDF.

These are quite manually intensive, though. (Which is why I said they may be good for only "one off" occurrences.) If you would like something a bit more automatic, you'll want to turn to using a macro to do the PDF files. Here's an example of a short macro that will do the PDF creation for you:

Sub CreatePDFs()
    Dim wks As Worksheet
    Dim sFolder As String
    Dim sTemp As String

    sFolder = ActiveWorkbook.Path & "\"

    sTemp = "Created PDFs for the following worksheets"
    For Each wks In ActiveWorkbook.Worksheets
        If wks.Visible = xlSheetVisible Then
            sTemp = sTemp & vbCrLf & "   * " & wks.Name
            wks.ExportAsFixedFormat Type:=xlTypePDF, _
              Filename:=sFolder & wks.Name & ".pdf", _
              OpenAfterPublish:=False
        End If
    Next

    MsgBox sTemp
End Sub

Note that the path stored in the sFolder variable is set to whatever path is associated with the active workbook. (If you haven't saved the active workbook yet, then the macro will not run properly.) This path is the folder in which the PDF files are saved. If you want them saved in a different location, just change the value assigned to the sFolder variable.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13570) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Determining a Column Width

When laying out your document, you may wonder what width you should use for your text. An old typographers trick may help ...

Discover More

Permanent Watermarks in a Document

Need to add a graphic watermark to a document? It's not that hard to do, but making the watermark permanent can be a bit ...

Discover More

Brackets around Footnote References

When you insert footnotes in a document, Word allows you to modify the formatting applied to the footnote references. ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (ribbon)

Adding Page Borders to a Printout

Need a full-page border on your Excel printouts? It's not as easy to get one as you might wish. There are a few ways you ...

Discover More

Black and White Blues

Getting a chart looking its best on a black-and-white printer can be a challenge. This tip examines different ways you ...

Discover More

Printing Multiple Pages On a Piece of Paper

If you want to save paper on a printout, you might consider printing multiple pages on a single piece of paper. This can ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 + 2?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.