How to make Excel generate sequential serial numbers?

  • Questions
  • How to make Excel generate sequential serial numbers?
Question ID: 104545
1
0

I’m trying to create a document in Excel that each time you open it, the serial number would be 1 higher. For instance the first time I open it, I’d want the number to be 00001, then 00002. But I don’t want it as a list in Excel, I want it to be a new number each time I open the document. Like how you would have an invoice or a Bill of Lading as a different number.

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on July 10, 2012 2:54 pm
12 views
Answers (2)
1
Private answer

Assuming your Serial number is in cell F3 you can use Excel's Auto_Open to call routine to increment that cell. Sample below:

Private Sub Auto_Open()
Call IncrementCounter
End Sub

Sub IncrementCounter()
Range(''F3'').Value = Range(''F3'').Value + 1
End Sub

Marked as spam
Posted by (Questions: 6, Answers: 5)
Answered on July 11, 2012 4:13 pm
1
Private answer

Right click on the sheet tab and go to 'View Code'. This will open the Microsoft Visual Basic editor. When it opens, on the left side double click on 'This Workbook'. That will open the macro code editor for the workbook. Then in the top two drop down menus, select Wookbook and Open. Then copy and paste the below. Then save and reopen the file. Each time you open the file it will automatically select sheet1 and add one to the value in cell B2.

Private Sub Workbook_Open()

Sheet(''Sheet1'').Select 'change Sheet1 here to the name of your sheet
Cells(2, 2).Value = Cells(2, 2).Value + 1

End Sub

You can also check [anthem bcbs co][1].

[1]: http://2healthinsurance.net/health-insurance-companies/anthem-bcbs-colorado/

Marked as spam
Posted by (Questions: 0, Answers: 1)
Answered on July 16, 2012 5:43 am