Excel Print Multiple Copies with Different Page Numbers
Yes, you can print multiple copies of an Excel worksheet with different page numbers by using a simple VBA macro or by manually adjusting the print settings for each copy. This article explains both methods, shows you how to set them up, and covers common pitfalls so you can get the job done quickly and accurately.
Why Would You Need Different Page Numbers on Each Copy?
Printing multiple copies with different page numbers is a common need in business and education. For example, you might need to distribute numbered tickets, numbered certificates, or sequentially numbered invoices that are generated from an Excel list. Each copy must have a unique number printed on it, even though the underlying content is the same. Excel’s built-in print dialog only lets you specify the number of copies, not a starting page number for each copy. That’s why a custom approach is required.
Method 1: Using a Simple VBA Macro
The most reliable way to print multiple copies with different page numbers is to use a VBA (Visual Basic for Applications) macro. This method works for any version of Excel that supports macros (Excel 2010 and later on Windows; Excel 2016 and later on Mac). Here’s how to set it up:
- Press Alt+F11 to open the VBA editor.
- In the menu, click Insert > Module to create a new code module.
- Copy and paste the following code into the module:
Sub PrintCopiesWithPageNumbers()
Dim startNum As Integer
Dim numCopies As Integer
Dim i As Integer
startNum = InputBox("Enter the starting page number for the first copy:")
numCopies = InputBox("How many copies do you want to print?")
For i = 0 To numCopies - 1
' Set the page number in a cell (e.g., A1) or in the header/footer
ThisWorkbook.Sheets(1).Range("A1").Value = startNum + i
' Print the current copy
ThisWorkbook.Sheets(1).PrintOut Copies:=1
Next i
End Sub
- Close the VBA editor and run the macro by pressing Alt+F8, selecting PrintCopiesWithPageNumbers, and clicking Run.
This macro asks for a starting number and the number of copies. It then writes the page number into cell A1 (or any cell you specify) before printing each copy. You can adapt it to place the number in a header or footer by using ActiveSheet.PageSetup.CenterFooter or similar properties.
Method 2: Manual Printing (For a Few Copies)
If you only need a handful of copies, you can do it manually without any code. Simply change the page number in the cell (or header) and print one copy at a time. For example, if you have a cell that contains the page number, you can:
- Type the first number (e.g., 101) in the cell.
- Print one copy using Ctrl+P.
- Change the cell to 102.
- Print again, and so on.
This is tedious for many copies, but it works and requires no technical skill. For a more efficient manual approach, you can use the Print Titles feature to repeat a row that contains the page number, and then adjust the number before each print.
How to Choose the Right Method
Choosing between VBA and manual printing depends on your situation:
- Number of copies: If you need more than 5–10 copies, a macro is worth the setup time.
- Frequency: If you’ll do this regularly, invest in a macro once and reuse it.
- Technical comfort: If you’re not comfortable with VBA, the manual method is safer.
- Where the number appears: If the number is in a cell, both methods work. If it’s in the header/footer, VBA is easier for automation.
Common Problems and How to Avoid Them
Here are typical issues you might encounter and how to solve them:
- Page numbers not updating: Make sure the cell or header is linked to the variable you’re changing. In a macro, always set the value before printing.
- Macro security warnings: Excel may block macros by default. Go to File > Options > Trust Center > Trust Center Settings > Macro Settings and enable “Enable all macros” (only for trusted workbooks).
- Printing the same page twice: If you use the built-in print dialog with multiple copies, Excel prints identical copies. That’s why you must use the macro or manual method.
- Page numbers in headers/footers: To set a header/footer value in VBA, use
ActiveSheet.PageSetup.CenterHeader = "Page " & startNum + ibefore printing.
Alternative: Using a Mail Merge or Word
If your “copies” are actually different documents (like certificates), you might be better off using Microsoft Word’s Mail Merge feature. Excel can hold the list of numbers, and Word can generate a separate page for each number. This is especially useful when each copy has a unique name or other variable data, not just a page number. However, for printing the same Excel sheet with different numbers, the VBA method is simpler and stays within Excel.
Frequently Asked Questions
Can I print multiple copies with different page numbers without VBA?
Yes, but only manually. You can change the page number in a cell or header and print one copy at a time. There is no built-in Excel feature that automatically increments a number across copies.
How do I put the page number in the header instead of a cell?
In the VBA macro, replace the line that sets the cell value with a line that sets the header, like: ActiveSheet.PageSetup.CenterHeader = "Page " & (startNum + i). Make sure to clear the header after printing if you don’t want it to persist.
Will this work on Excel for Mac?
Yes, VBA is available in Excel for Mac, but the keyboard shortcuts differ slightly (use Option+F11 to open the VBA editor). The code itself is identical.
Can I print different page numbers on each sheet of a multi-sheet workbook?
Yes, you can loop through each sheet in the macro and assign a different starting number for each sheet. For example, have the macro ask for a starting number for each sheet, or use a list of numbers stored in a column.
What if my page numbers are not sequential (e.g., 101, 105, 110)?
You can modify the macro to read numbers from a list in a column instead of using a simple increment. For example, store the numbers in cells A1:A10 and loop through that range.
Is there a way to print different page numbers on each copy using the built-in print dialog?
No. The print dialog only allows you to set the number of copies, and all copies are identical. You must use a macro or manual editing to change the page numbers.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.