unique page numbers

I

ian5001

I want to create an invoice templete that opens with a +1 number in a
cell. For example; my first invoice / spreadsheet is number 0001, the
next time I open the 'template' it shows 0002 and so on. Is this
possible? thanks.
 
J

Jim

Private Sub Workbook_Open()
Worksheets("Sheet1").Select
Range("A1").Value = Range("A1") + 1
End Sub

Each time the wb is opened, the number will increment by 1.
Of course, change the cell reference to meet your needs.
 
E

Earl Kiosterud

I don't mean do a rain dance for this parade, but here are a couple of
things to be aware of.

If the worksheet doesn't get saved, you'll have the same invoice number for
the next opening of the workbook. (The user might print the invoice, then
for one reason or another, not save it). It might be a good idea to do a
save in the macro after the number has been incremented.

Also, this gives no history of invoice numbers.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

Jim said:
Private Sub Workbook_Open()
Worksheets("Sheet1").Select
Range("A1").Value = Range("A1") + 1
End Sub

Each time the wb is opened, the number will increment by 1.
Of course, change the cell reference to meet your needs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top