Forum Discussion
David Muth
Aug 28, 2018Copper Contributor
Visual Basic and Sequential numbers
Hello
I have created Visual Basic code to create an auto number, when I run the Visual basic code, but I am trying to figure out how to run it automatically so that each time the document opens it will create a new unique number.
- Haytham AmairahSilver Contributor
Hi David,
Press Alt+F11 to open the VBA editor, then select ThisDocument code module, and copy your code inside Document_Open() event as shown in the below screenshot.
Hope that helps
- David MuthCopper ContributorPerfect. Thank you
- Steven FrancoCopper Contributor
David,
Would it be possible to borrow the code you created to do this? I am looking for a way that every time my excel template is opened and saved it is given a unique but sequential number from the previous time. Similar to a quoting system or a transaction ID