How to Print Multiple Sheets in Excel VBA: Complete Guide with Practical Use Cases
Contents
- How to Print Multiple Sheets in Excel VBA: Complete Guide with Practical Use Cases
- ✅ Why Automate Multi-Sheet Printing with VBA
- ✅ Understanding How Excel Handles Multi-Sheet Printing
- ✅ Step 1: Basic Example – Print All Sheets in the Workbook
- ✅ Step 2: Print Only Selected Sheets
- ✅ Step 3: Print All Visible Sheets Only
- ✅ Step 4: Add Confirmation Before Printing
- ✅ Step 5: Print a Dynamic List of Sheets
- ✅ Step 6: Combine Sheets into One Print Job (Recommended)
- ✅ Step 7: Preview Before Printing
- ✅ Step 8: Apply Page Settings to All Sheets Before Printing
- ✅ Step 9: Exclude Certain Sheets Automatically
- ✅ Step 10: Automate PDF Export of Multiple Sheets
- ✅ Step 11: Add User Interface with Buttons
- ✅ Step 12: Create a “Selective Print” System with Checkboxes
- ✅ Step 13: Batch Print Sheets by Keyword
- ✅ Step 14: Integrate with RPA Tools (UiPath Example)
- ✅ Step 15: Add Status Bar Updates for Long Print Jobs
- ✅ Step 16: Error Handling – Avoid Crashes
- ✅ Step 17: Example – Professional Reporting Workflow
- ✅ Step 18: Common Troubleshooting Tips
- ✅ Step 19: Extending Multi-Sheet Printing Beyond Excel
- ✅ Step 20: Full Example – End-to-End Automated Multi-Sheet Printing System
- ✅ Summary: Automate Multi-Sheet Printing for Efficiency and Accuracy
In the modern office environment, professionals often manage large workbooks containing multiple sheets — such as summaries, detailed data, invoices, and charts. Printing them one by one wastes time and risks missing pages.
Excel VBA can automate this entire process, allowing you to print multiple sheets in just one click, while maintaining consistent formatting and layout. Whether you need to print reports for management, invoices for clients, or compliance forms, mastering this technique saves both time and errors.
This comprehensive guide explains how to print multiple sheets in Excel VBA, step by step, with plenty of practical examples for business use.
✅ Why Automate Multi-Sheet Printing with VBA
Manual printing across several sheets can quickly become repetitive and error-prone.
Automation ensures that every print job follows a consistent sequence and uses uniform settings.
Benefits of multi-sheet automation
- One-click printing of entire reports or departments
- Consistent paper size, margins, and orientation
- No risk of skipping or misprinting a sheet
- Ideal for scheduled RPA workflows (Excel + UiPath)
- Easy customization for specific sheet names or dynamic conditions
With VBA, you gain precise control and reliability that manual operations simply cannot match.
✅ Understanding How Excel Handles Multi-Sheet Printing
When you select multiple sheets manually in Excel and press Ctrl + P, they print together in a single job.
VBA can replicate and enhance this behavior programmatically.
・Two main approaches
- Selecting sheets as an array and printing together
→ Faster and preserves layout consistency - Looping through each sheet individually
→ Offers control per sheet (headers, conditions, skipping hidden sheets)
You can choose the method that best suits your workflow.
✅ Step 1: Basic Example – Print All Sheets in the Workbook
If you want to print every sheet without exception:
Sub PrintAllSheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.PrintOut
Next ws
End Sub
✅ Result: Each sheet is printed sequentially using the workbook’s default print settings.
This simple loop is perfect for internal reports or quick documentation.
✅ Step 2: Print Only Selected Sheets
Sometimes, not every sheet should be printed — for example, “Summary,” “Invoice,” and “Chart” only.
Sub PrintSpecificSheets()
Sheets(Array("Summary", "Invoice", "Chart")).PrintOut
End Sub
✅ Prints the specified sheets together in one print job.
This method preserves page numbering continuity across the set, making it suitable for multi-section reports.
✅ Step 3: Print All Visible Sheets Only
Hidden or backup sheets should often be excluded. You can handle that dynamically:
Sub PrintVisibleSheetsOnly()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Visible = xlSheetVisible Then
ws.PrintOut
End If
Next ws
End Sub
✅ Automatically ignores hidden sheets like “Config” or “Archive.”
✅ Step 4: Add Confirmation Before Printing
To avoid accidental bulk printing:
Sub ConfirmBeforePrinting()
Dim ans As VbMsgBoxResult
ans = MsgBox("Print all sheets in this workbook?", vbYesNo + vbQuestion, "Confirm Print")
If ans = vbYes Then
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.PrintOut
Next ws
Else
MsgBox "Printing cancelled."
End If
End Sub
✅ Adds user interaction for safety, especially useful in shared files.
✅ Step 5: Print a Dynamic List of Sheets
In complex workbooks, the list of sheets to print may change based on user input or data values.
・Example using named range or list
Sub PrintFromList()
Dim ws As Worksheet
Dim cell As Range
For Each cell In Range("SheetList")
Set ws = ThisWorkbook.Sheets(cell.Value)
ws.PrintOut
Next cell
End Sub
✅ When you maintain a “SheetList” named range (e.g., A1:A5), this macro automatically prints those sheets.
✅ Step 6: Combine Sheets into One Print Job (Recommended)
To maintain uniform headers, footers, and page numbering:
Sub PrintCombinedSheets()
Sheets(Array("Summary", "Details", "Charts")).Select
ActiveWindow.SelectedSheets.PrintOut
Sheets("Summary").Select
End Sub
✅ All selected sheets print together in one job.
Page numbers flow continuously across sheets, ideal for multi-page reports.
✅ Step 7: Preview Before Printing
Previewing saves paper and catches layout issues early.
Sub PreviewMultipleSheets()
Sheets(Array("Summary", "Details", "Charts")).PrintPreview
End Sub
✅ Opens a unified preview window to inspect layout and scaling before confirming.
How to Display Print Preview in Excel VBA: Step-by-Step Guide with Practical Use Cases
✅ Step 8: Apply Page Settings to All Sheets Before Printing
Uniform appearance is crucial when printing multiple sheets.
Sub ApplyPageSetupAll()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws.PageSetup
.Orientation = xlLandscape
.PaperSize = xlPaperA4
.FitToPagesWide = 1
.FitToPagesTall = False
.CenterHorizontally = True
.CenterFooter = "Page &P of &N"
End With
Next ws
End Sub
✅ Sets layout consistency across all worksheets.
Combine this with a printing macro for a professional finish.
✅ Step 9: Exclude Certain Sheets Automatically
For example, skip sheets starting with “_” (system sheets).
Sub PrintExcludeCertainSheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If Left(ws.Name, 1) <> "_" Then
ws.PrintOut
End If
Next ws
End Sub
✅ Keeps system or log sheets untouched, streamlining printing workflows.
✅ Step 10: Automate PDF Export of Multiple Sheets
Instead of printing to paper, output all selected sheets to a single PDF.
Sub ExportMultipleSheetsPDF()
Sheets(Array("Summary", "Details", "Charts")).Select
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=ThisWorkbook.Path & "\FullReport.pdf", _
Quality:=xlQualityStandard
Sheets("Summary").Select
End Sub
✅ Exports all pages into a unified PDF report — ideal for emailing or document storage.
This integrates seamlessly with UiPath for automatic distribution.
✅ Step 11: Add User Interface with Buttons
You can make printing accessible to anyone using on-sheet buttons.
- Go to Developer → Insert → Form Controls → Button.
- Draw the button on your summary sheet.
- Assign your multi-sheet print macro.
- Label it as “Print All Reports.”
✅ Now, with a single click, users print multiple sheets instantly.
✅ Step 12: Create a “Selective Print” System with Checkboxes
For advanced usability, allow users to select which reports to print.
・Setup example
- Column A lists sheet names.
- Column B has checkboxes or “Yes/No” indicators.
Sub PrintSelectedSheets()
Dim ws As Worksheet
Dim i As Long
For i = 2 To 10
If Cells(i, 2).Value = "Yes" Then
Sheets(Cells(i, 1).Value).PrintOut
End If
Next i
End Sub
✅ Dynamic and user-friendly for dashboards shared across departments.
✅ Step 13: Batch Print Sheets by Keyword
If your workbook contains grouped sheets (e.g., “Sales_Q1”, “Sales_Q2”), print them by keyword:
Sub PrintByKeyword()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If InStr(1, ws.Name, "Sales") > 0 Then
ws.PrintOut
End If
Next ws
End Sub
✅ Great for category-based reports, like regions, months, or departments.
✅ Step 14: Integrate with RPA Tools (UiPath Example)
RPA systems like UiPath can call these macros automatically:
- UiPath opens the Excel file.
- It runs a VBA script via “Execute Macro.”
- VBA prints all target sheets or exports a PDF.
- UiPath emails or uploads the result automatically.
✅ Perfect for nightly or weekly automated reporting — no human intervention needed.
✅ Step 15: Add Status Bar Updates for Long Print Jobs
When printing dozens of sheets, it’s helpful to show progress.
Sub PrintWithProgress()
Dim ws As Worksheet, i As Long, total As Long
total = ThisWorkbook.Worksheets.Count
i = 0
For Each ws In ThisWorkbook.Worksheets
i = i + 1
Application.StatusBar = "Printing sheet " & i & " of " & total & ": " & ws.Name
ws.PrintOut
Next ws
Application.StatusBar = False
MsgBox "All sheets printed successfully!"
End Sub
✅ Keeps users informed, avoiding confusion during lengthy tasks.
✅ Step 16: Error Handling – Avoid Crashes
Always include basic error trapping when looping through sheets.
Sub SafeMultiPrint()
On Error Resume Next
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.PrintOut
If Err.Number <> 0 Then
MsgBox "Error printing: " & ws.Name
Err.Clear
End If
Next ws
MsgBox "Multi-sheet printing completed."
End Sub
✅ Protects your workflow even if a printer error or missing sheet occurs.
✅ Step 17: Example – Professional Reporting Workflow
Scenario:
A company wants to print:
- Summary
- Department Reports (Dept_A to Dept_E)
- Charts
Solution:
Sub CorporateReportPrint()
Dim arrSheets As Variant
arrSheets = Array("Summary", "Dept_A", "Dept_B", "Dept_C", "Dept_D", "Dept_E", "Charts")
Sheets(arrSheets).Select
ActiveWindow.SelectedSheets.PrintOut
Sheets("Summary").Select
MsgBox "Corporate report printing completed!"
End Sub
✅ Produces a professional, multi-section report in one clean sequence.
✅ Step 18: Common Troubleshooting Tips
| Issue | Cause | Fix |
|---|---|---|
| Wrong sheet order | Array order incorrect | Reorder sheet names in array |
| Hidden sheets printed | Not filtered | Use .Visible = xlSheetVisible check |
| Different layouts per sheet | Inconsistent PageSetup | Apply uniform layout before print |
| Slow printing | Many graphics / formulas | Turn off screen updating |
| Macro security warning | VBA unsigned | Sign or enable trusted macros |
・Speed Optimization
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
'... your loop code ...
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
✅ Reduces delay significantly for large workbooks.
✅ Step 19: Extending Multi-Sheet Printing Beyond Excel
- Combine Excel VBA with Outlook automation to email PDFs after printing.
- Use Power Automate or UiPath to schedule regular printing tasks.
- Integrate with SharePoint or Teams for automatic document storage.
By connecting Excel to larger automation ecosystems, you elevate simple VBA macros into enterprise solutions.
✅ Step 20: Full Example – End-to-End Automated Multi-Sheet Printing System
This final macro combines setup, printing, and PDF export with status updates.
Sub AutomatedMultiPrint()
Dim ws As Worksheet
Dim FilePath As String
Dim SheetNames As Variant
'Define sheets to print
SheetNames = Array("Summary", "Details", "Charts")
'Apply consistent layout
For Each ws In ThisWorkbook.Worksheets
With ws.PageSetup
.Orientation = xlLandscape
.FitToPagesWide = 1
.FitToPagesTall = False
.CenterHorizontally = True
.CenterFooter = "Page &P of &N"
End With
Next ws
'Status bar update
Application.StatusBar = "Printing selected sheets..."
Sheets(SheetNames).Select
ActiveWindow.SelectedSheets.PrintOut
Sheets("Summary").Select
'PDF export
FilePath = ThisWorkbook.Path & "\FullReport_" & Format(Now, "yyyymmdd_hhmmss") & ".pdf"
Sheets(SheetNames).Select
ActiveSheet.ExportAsFixedFormat xlTypePDF, FilePath
Sheets("Summary").Select
Application.StatusBar = False
MsgBox "All sheets printed and PDF exported successfully!" & vbCrLf & "File saved at: " & FilePath
End Sub
✅ Produces both printed and digital outputs in one run — ideal for automated reporting workflows in organizations.
✅ Summary: Automate Multi-Sheet Printing for Efficiency and Accuracy
- Excel VBA allows one-click printing of multiple sheets.
- Choose between array selection or per-sheet looping.
- Use uniform page setup for professional results.
- Add confirmation, progress tracking, and error handling.
- Integrate with UiPath or Power Automate for end-to-end automation.
- Export to PDF to eliminate paper dependency.
By mastering multi-sheet printing in Excel VBA, you transform a tedious manual task into an efficient, reliable, and fully automated process.
From daily operations to high-level management reports, your Excel workbooks become powerful printing and publishing systems — all triggered by a single click.
