Auto Numbering

G

Guest

What is the best way to generate an auto number, like an invoice number, on a
template so that each time a new workbook is created a sequential number
appears

thanks in advance
 
S

Steve Jones

Hi

I always use this for numbering documents, it might not be good code but it
works well enough for me.

EG:
In cell A1 enter a number say 12345
Cell B1 enter 1 (the number you wish to increment by)
Cell C1 = A1+B1 (your document no. = 12346)

Use a button to operate the following code.

Sub IncOrdNum()

Application.ScreenUpdating = False

Range("c1").Select
Selection.Copy
Range("a1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Application.CutCopyMode = False

End Sub

Regards

Steve
 

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