ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how to print a page many times but add a unique reference on each (https://www.excelbanter.com/excel-worksheet-functions/81943-how-print-page-many-times-but-add-unique-reference-each.html)

ms_540

how to print a page many times but add a unique reference on each
 
I wish to print a single document many times, about 500, and I would like
there to be a separate reference number on each printed page(preferably a
consecutive count of the number of printed pages). I am not sure whether
there is a formula which would let me do this. However, i dont think it would
be pratical to create around 500 separate worksheets, so is there a way to
have this done automatically when the document is printed?

John Michl

how to print a page many times but add a unique reference on each
 
You could do this with a simple macro such as the following:

Open the VBA Editor by pressing Alt-F11
From the menu choose, Insert Module

The past the following code in that module.
In Excel launch the macro by pressing Alt-F8, selecting it then Run.

Sub PrintMultiple()

i = InputBox("Enter number to print?")

For x = 1 To i
Worksheets("Sheet1").Range("A1").Value = x
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Next x

MsgBox i & " copies printed"

End Sub

Change to suit.

- John



All times are GMT +1. The time now is 01:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com