2

I have an Excel sheet I use as an invoice.

I want to print 100 pages and I want the invoice number to change from 1 to 100, so that each paper will have different invoice number.

How can I do this?

2
  • Do you need to do all the printing in one run, or are you going to open the file, print once, close, repeat sometime later? Oct 27 '10 at 12:41
  • i will printing all in one run, then in the future maybe i want to continue and repeat it .. thanks
    – khalid
    Oct 27 '10 at 12:43
3

You need a macro for that. I found the following macro and made some changes on it. Try it to see if it works correctly:

Sub PrintCopies_ActiveSheet()

Dim CopiesCount As Long
Dim copynumber As Long

CopiesCount = Application.InputBox("How many copies do you want?", Type:=1)
'Now the program wants you to input how many pages you like to print.
'You can input 100 here.

For copynumber = 1 To CopiesCount
With ActiveSheet
   .Range("E1").Value = copynumber 'I assume your invoice number is in cell E1.
   .PrintOut 'Print the sheet
End With
Next copynumber
End Sub
2
  • the only problem is that i can't start from 100 or 1000, always it's start from 1
    – khalid
    Nov 25 '10 at 12:01
  • Change this line: For copynumber = 1 To CopiesCount as For copynumber = 100 To CopiesCount Nov 25 '10 at 15:01
1

I would use a macro to do this, as there doesn't seem to be an easy, built in method of doing this. The outline of the macro would be pretty simple. Something of this nature:

  1. Prompt for number of copies and printer name
  2. Set The invoice Number cell to 0
  3. Loop for number of copies
    1. Increment the invoice cell number
    2. Print the document to printer name

Edit

This page has an example of it for Word, so you could just adapt this to excel. This page has a rough example for excel

1
  • or if you're going to use the same printer each time, and always print 100 copies, you can skip step 1.
    – xdumaine
    Oct 27 '10 at 13:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.