Macro for sequential numbering.

J

Jeff W

I have a template for inventory movement. I want to create a macro to give
each new document a unique number. I want the number to be in cell B4. I
have created a macro in word, but I can not figure out how to do this in
excel. I am a novice and would appreciate any assistance on the process of
creating the macro and what syntax to place in the VBA editor.

Thanks.
 
J

Jeff W

Thanks for the quick response Mike. I have copied the syntax exactly as was
on the website, but I am not getting am invoice number when I open a new
document using the template. I would like for the number to appear on the
document itself. (In cell B2 to be exact). Any idea what am I doing wrong?
 
G

Gord Dibben

Which method did you choose for storing the number?

Registry or *.txt file?

Did you also place the

Public Sub Workbook_Open()
ThisWorkbook.Sheets(1).Range("B2").Value = NextSeqNumber
End Sub

in Thisworkbook module?


Gord Dibben MS Excel MVP
 

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