Macro for sequential numbering.

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