ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro for sequential numbering. (https://www.excelbanter.com/excel-discussion-misc-queries/194578-macro-sequential-numbering.html)

Jeff W

Macro for sequential numbering.
 
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.
--
Jeff W

Mike H

Macro for sequential numbering.
 
Hi,

This must be a contender for the most often asked question. Have a look here.

http://www.mcgimpsey.com/excel/udfs/sequentialnums.html

Mike

"Jeff W" wrote:

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.
--
Jeff W


Gord Dibben

Macro for sequential numbering.
 

See John McGimpsey's site for methods.

http://www.mcgimpsey.com/excel/udfs/sequentialnums.html


Gord Dibben MS Excel MVP


On Fri, 11 Jul 2008 13:57:02 -0700, Jeff W
wrote:

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.



Jeff W

Macro for sequential numbering.
 
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?
--
Jeff W


"Mike H" wrote:

Hi,

This must be a contender for the most often asked question. Have a look here.

http://www.mcgimpsey.com/excel/udfs/sequentialnums.html

Mike

"Jeff W" wrote:

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.
--
Jeff W


Gord Dibben

Macro for sequential numbering.
 
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

On Fri, 11 Jul 2008 16:51:01 -0700, Jeff W
wrote:

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?




All times are GMT +1. The time now is 06:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com