Can Excell create a running invoice NUMBER?

B

BigG

Lets say I was to create a form that will be used over and over, but
everytime I fill it out and print it I need it to generate a number
that changes 1 digit each time it is pulled up and printed.

Example, I have a blank invoice, then I fill in the fields as needed
and the invoice has a number on the top numbered 00001
so I print it and close the file. Then tomorrow I open it and do the
same thing except the invoice number now is set at 00002.

I am not sure if Excel can do this or not.
This would be pulling a rabbit out of a hat if this can be done :cool:


G.
 
F

Frank Kabel

Hi
you can process the worksheet_beforeprint event:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Sheets("Sheet1").Range("A1") =
Sheets("Sheet1").Range("A1") + 1
End Sub

this will increment cell A1 on sheet1 by one for each print-job. You
have to put this code into the workbook module of your workbook

HTH
Frank
Lets say I was to create a form that will be used over and over, but
everytime I fill it out and print it I need it to generate a number
that changes 1 digit each time it is pulled up and printed.

Example, I have a blank invoice, then I fill in the fields as needed
and the invoice has a number on the top numbered 00001
so I print it and close the file. Then tomorrow I open it and do the
same thing except the invoice number now is set at 00002.

I am not sure if Excel can do this or not.
This would be pulling a rabbit out of a hat if this can be done
:cool:
 
Top