How do i create an autonumber in excel

A

Arild

I wonder how i can get a autonumber in excel when i open the document. I have
allready a defined the numbers i will use. For excample: 1 to 1000 is the
number i would like to use.
Every time the users open the excel-document it will automaticly give a new
number to the for excample "ordering" scheme.

Someone....help me ?
[email protected]
 
P

Patrick Molloy

either you need to save the number externally somewhere or save your workbook
each day.
If you're saving it, then you can use the Workbook's open event to indrement
the cell
in the developement IDE, double click on ThisWorkbook in the Project browser.

add code like this...

Option Explicit
Private Sub Workbook_Open()
Dim target As Range
Set target = Worksheets("Sheet1").Range("B2")
target = target + 1
End Sub
 
Top