unique page numbers

  • Thread starter Thread starter ian5001
  • Start date Start date
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.
 
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.
 
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.
 
Back
Top