How to Skip Specific Pages When Printing in Excel
Question details
The user needs to print specific pages from a large Excel workbook while skipping others, utilizing a custom list and VBA macros.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Printing large workbooks with hundreds of pages where only specific, non-contiguous pages are required.
- Observed behavior
- The user wants to automate the process of printing selected pages individually while efficiently bypassing the unwanted pages.
Before running any VBA macros, save a copy of your workbook as a backup and ensure that macros are enabled in your Excel Trust Center settings.
Use a VBA Macro to Print Selected Pages
Create a list of desired page numbers and use a VBA macro to loop through the list, printing only the pages you specify.
This method is ideal for large workbooks with hundreds of pages. By explicitly listing the page numbers you want to keep, the macro will automatically skip the ones you omit.
In a new or existing worksheet, create a dedicated column and type the specific page numbers you want to print.
Press 'Alt + F11' on your keyboard to open the Visual Basic for Applications (VBA) editor.
Click 'Insert' from the top menu bar and select 'Module' to create a blank script window.
Write or paste a VBA script that loops through your created list and uses the PrintOut method for each specified page number.
Close the VBA editor, return to your workbook, press 'Alt + F8', select your new print macro, and click 'Run'.

Manually Define Print Settings in Batches
For smaller documents, you can manually print non-contiguous page ranges using the standard print dialog.
Easily Manage and Print Specific Pages with WPS Office
WPS Office provides intuitive page layout management, advanced print settings, and excellent macro support, allowing you to easily select, skip, and print specific pages in large spreadsheets.
- 1. Open File: Open your spreadsheet in WPS Office.
- 2. Access Page Layout: Navigate to the 'Page Layout' tab to manage your print areas.
- 3. Open Print Settings: Press 'Ctrl + P' to access the custom print range settings.
- 4. Use the Macro Editor: If using a custom script, press 'Alt + F11' to open the WPS Macro Editor and run your automated print job.

Frequently Asked Questions
Can I print non-contiguous pages in Excel without using a VBA macro?
Yes, you can manually print non-contiguous pages by opening the print dialog (Ctrl + P) and printing each continuous page range separately. However, this manual method can be time-consuming for very large documents.
Why is my VBA print macro not working?
Your macro may fail if macros are disabled in your Trust Center security settings, or if the page numbers referenced in your worksheet list exceed the actual number of pages currently in the workbook.
How do I save a workbook that contains a VBA print macro?
You must save your document as an Excel Macro-Enabled Workbook (.xlsm). Standard Excel workbooks (.xlsx) cannot store VBA code, and your macro will be lost if saved in that format.




