How to convert multiple workbooks or worksheets to PDF files at once in Excel?
Converting Excel files to PDF is a common task when you want to share data while preventing modifications. While Excel's Save As feature allows you to convert a single workbook to PDF, it can be time-consuming for multiple files. This guide explores various methods, including VBA code and Kutools for Excel, to quickly convert multiple workbooks or worksheets to PDF files at once.
- Convert multiple workbooks to PDF files with Save As function one by one
- Convert multiple workbooks to PDF files with VBA code all at once
- Convert multiple workbooks to PDF files with a powerful feature
- Convert multiple worksheets from a workbook to separate PDF files with VBA code
- Convert multiple worksheets from a workbook to separate PDF files with a handy feature
Convert multiple workbooks to PDF files with Save As function one by one
Normally, the Save As feature in Excel can help you to save the entire workbook to a PDF file, please do as this:
1. Launch the workbook that you want to convert to PDF format.
2. Click File > Save As, and in the Save As dialog box, please specify a folder for saving the new file, then select PDF from the Save as type drop down list, and then, click Options button, see screenshot:
3. Then, in the popped out Options dialog box, check Entire workbook, see screenshot:
4. And then click OK > Save, this whole workbook has been saved as PDF file format.
Convert multiple workbooks to PDF files with VBA code at once
If there are hundreds of Excel files that need to be converted, the above method will be troublesome, here, I will talk about a VBA code for converting multiple workbooks to PDF files at once, please do with the following steps:
1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following code into the Module Window.
VBA code: Convert multiple workbooks to PDF files at once
Sub ExcelSaveAsPDF()
'Updateby Extendoffice
Dim strPath As String
Dim xStrFile1, xStrFile2 As String
Dim xWbk As Workbook
Dim xSFD, xRFD As FileDialog
Dim xSPath As String
Dim xRPath, xWBName As String
Dim xBol As Boolean
Set xSFD = Application.FileDialog(msoFileDialogFolderPicker)
With xSFD
.Title = "Please select the folder contains the Excel files you want to convert:"
.InitialFileName = "C:\"
End With
If xSFD.Show <> -1 Then Exit Sub
xSPath = xSFD.SelectedItems.Item(1)
Set xRFD = Application.FileDialog(msoFileDialogFolderPicker)
With xRFD
.Title = "Please select a destination folder to save the converted files:"
.InitialFileName = "C:\"
End With
If xRFD.Show <> -1 Then Exit Sub
xRPath = xRFD.SelectedItems.Item(1) & "\"
strPath = xSPath & "\"
xStrFile1 = Dir(strPath & "*.*")
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Do While xStrFile1 <> ""
xBol = False
If Right(xStrFile1, 3) = "xls" Then
Set xWbk = Workbooks.Open(Filename:=strPath & xStrFile1)
xbwname = Replace(xStrFile1, ".xls", "_pdf")
xBol = True
ElseIf Right(xStrFile1, 4) = "xlsx" Then
Set xWbk = Workbooks.Open(Filename:=strPath & xStrFile1)
xbwname = Replace(xStrFile1, ".xlsx", "_pdf")
xBol = True
ElseIf Right(xStrFile1, 4) = "xlsm" Then
Set xWbk = Workbooks.Open(Filename:=strPath & xStrFile1)
xbwname = Replace(xStrFile1, ".xlsm", "_pdf")
xBol = True
End If
If xBol Then
xWbk.ExportAsFixedFormat Type:=xlTypePDF, Filename:=xRPath & xbwname & ".pdf"
xWbk.Close SaveChanges:=False
End If
xStrFile1 = Dir
Loop
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
3. Press F5 key to run this code, and a window will be displayed, please select a folder which contains the workbooks that you want to convert, see screenshot:
4. Click OK, another window is popped out, please select a folder path where you want to output the new PDF files, see screenshot:
5. Click OK, after finishing the conversion, you can go to the specified folder to view the converted result, see screenshots:
![]() | ![]() | ![]() |
Convert multiple workbooks to PDF files with a powerful feature
If you have Kutools for Excel, with its Format Converter utility, you can quickly convert multiple workbooks to PDF files at once.
1. Click Kutools Plus > Workbook > Format Converter, see screenshot:
2. A prompt box will pop up reminding you to close the workbooks that you want to convert.
3. Click OK, then, in the FileFormat Converter dialog, specify the following options:
- Under the Convert type drop down list, select Excel workbook to PDF;
- Click the Add button to select the Excel files you want to convert. You can choose workbooks from your computer or OneDrive as needed
4. After inserting the workbooks that you want to convert, still in the File Format Converter dialog box, please click button to choose one folder path to output the converted files, and then specify some operations you need at the bottom of the dialog box, see screenshot:
- To include workbooks in subfolders, check the Include subfolders when adding folders box;
- If you want to remove the original files after converting, please check the Delete source files after conversion box;
- If you want to keep the modified date of original files, please check the Keep modified date of original files box;
- The directory structure of the file can be retained by checking the The directory structure of the file is preserved when converted box;
5. Then click OK to start converting. Once all the specified Excel files are converted to PDFs, navigate to the designated folder to view the results. See screenshots below:
![]() | ![]() | ![]() |
Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy permanently free AI features! Get It Now
Convert multiple worksheets from a workbook to separate PDF files with VBA code
In some cases, you may want to convert each worksheet in the workbook to separate PDF files. If your workbook contains many sheets, the VBA code below can help save each worksheet as a separate PDF file simultaneously.
1. Open a workbook that you want to convert, and then hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following code into the Module Window.
VBA code: Convert multiple worksheets from a workbook to separate PDF files
Sub SplitEachWorksheet()
'Updateby Extendoffice
Dim xSPath As String
Dim xSFD As FileDialog
Dim xWSs As Sheets
Dim xWb As Workbook
Dim xWbs As Workbooks
Dim xNWb As Workbook
Dim xInt, xI As Integer
Set xSFD = Application.FileDialog(msoFileDialogFolderPicker)
With xSFD
.title = "Please select a folder to save the converted files:"
.InitialFileName = "C:\"
End With
If xSFD.Show <> -1 Then Exit Sub
xSPath = xSFD.SelectedItems.Item(1)
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set xWb = Application.ActiveWorkbook
Set xWbs = Application.Workbooks
Set xWSs = xWb.Sheets
Set xNWb = xWbs.Add
xInt = xWSs.Count
For xI = 1 To xInt
On Error GoTo EBreak
Set xWs = xWSs.Item(xI)
If xWs.Visible Then
xWSs(xWs.Name).Copy
Application.ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=xSPath & "\" & xWs.Name & ".pdf"
Application.ActiveWorkbook.Close False
End If
EBreak:
Next
xWb.Activate
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
3. Press F5 key to run this code, and a window will pop up; please choose a folder path to save the converted PDF files. See screenshot:
4. Click OK button, and all worksheets in the current workbook will be converted into separate PDF files:
Convert multiple worksheets from a workbook to separate PDF files with a handy feature
Kutools for Excel also supports a useful feature - Split Workbook, with this feature, you can save multiple worksheets within the workbook to separate Excel file, Txt file, CSV file and PDF file as you need.
1. Open the workbook where you want to save each sheet as a separate PDF file, and then click Kutool Plus > Workbook > Split Workbook, see screenshot:
2. In the Split Workbook dialog box, check the sheet that you want to save, and then choose PDF (*.pdf) from the Save as type drop down list, and then click Split button, in the Select Folder window, specify a folder for putting the converted files, see screenshot:
![]() | ![]() | ![]() |
3. And then, all selected worksheets in the current workbook have been saved to PDF files individually, see screenshot:
Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy permanently free AI features! Get It Now
More relative articles:
- Convert Multiple Xls Files To Xlsx Files In Excel
- To convert an old xls Excel file to a new xlsx file, you can apply the Save As feature in Excel, but, if there are multiple xls files needed to be converted, how could deal with this task quickly and easily?
- Save All Worksheets As Values Only
- If you have a workbook which contains multiple formulas, now, you need to distribute this file to other users, you donβt want to show the formulas but only values be displayed. Normally, we can quickly save a worksheet as values by copying and pasting the data as values only. But, how could you save all worksheets as values only without copying and pasting one by one?
- Command Button To Save Active Worksheet As PDF File
- While working in Microsoft Excel, you may face the problem of saving active worksheet as PDF file. In this article, you can learn how to save active worksheet as PDF file with VBA code through a Command Button. And if you also want to save a range or each worksheet in active workbook as individual PDF file, this article can also help you.
- Split A Large Table Into Multiple Small Tables
- If you have a large worksheet which contains multiple columns and hundreds or thousands of rows data, now, you want to split this large table into multiple small tables based on the column value or number of rows to get the following results. How could you deal with this task in Excel?
- Split A Workbook To Separate Excel Files
- You may need to split a large workbook to separate Excel files with saving each worksheet of the workbook as an individual Excel file. For example, you can split a workbook into multiple individual Excel files and then deliver each file to different person to handle it. By doing so, you can get certain persons handle specific data, and keep your data safe. This article will introduce ways to split a large workbook to separate Excel files based on each worksheet.
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.





- All-in-one suite β Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license β set up in minutes (MSI-ready)
- Works better together β streamlined productivity across Office apps
- 30-day full-featured trial β no registration, no credit card
- Best value β save vs buying individual add-in