If you have a need to create serial numbers in your documents and they are very simple in nature, you can do so using a macro. This approach to serial numbers is great if your serial numbers are sequential (1, 2, 3, etc.) or regular in their incidence (3, 5, 7, etc.).
To begin, you should enter the macro that will control the change of the serial number and the printing of your document. You can use the following macro:
Sub MySerial() Dim rngSerialLocation As Range Dim intSerialNum As Integer Dim strSerialNum As String Dim docCurrent As Document Dim intNumCopies As Integer Dim intCount As Integer ' set ref to current active doc Set docCurrent = Application.ActiveDocument ' set ref to the bookmarked serial number Set rngSerialLocation = docCurrent.Bookmarks("Serial").Range ' get the starting number intSerialNum = Val(rngSerialLocation.Text) ' get the number of copies required intNumCopies = Val(InputBox$("How many Copies?", _ "Print Serialized", "1")) For intCount = 1 To intNumCopies ' print the document docCurrent.PrintOut Range:=wdPrintAllDocument ' increment the serial number intSerialNum = intSerialNum + 1 ' put into formatted version strSerialNum = Format(intSerialNum, "00000") ' stuff into proper place rngSerialLocation.Text = strSerialNum Next intCount ' reset the bookmark, since the updating procedure ' wipes out the old one docCurrent.Bookmarks.Add Name:="Serial", _ Range:=rngSerialLocation End Sub
There is only one prerequisite to using the macro: you need to make sure that your document contains a bookmark named Serial. This bookmark should reference the serial number in your document, as you want it to appear in the first printed document. (When you are through running the macro, you can save the document and the serial number will be ready for the next time you want to use it.)
The macro also assumes that your serial number consists primarily of some numeric value that changes with each iteration. You can modify the incrementing of the serial number, as well as its formatting, in the For...Next loop within the macro.
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (9540) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Office 365. You can find a version of this tip for the older menu interface of Word here: Using Sequential Document Serial Numbers.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
Need to print on large pieces of paper? Word has a limit on the size of the paper it can use, but that might not be the ...
Discover MoreNeed to create a booklet with Word? Depending on your version, it could be as easy as changing how you print your final ...
Discover MoreNon-printing characters are very handy to view when editing a document. But what if you want those characters to no ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2017-08-09 17:07:50
George
how do I write a template to be share on a network drive that has a sequential number?
2017-02-01 01:33:00
Dee
I cannot the serial number to appear on even the original doc/print. I am using MS 2016 on windows 10. Can somebody please help me...?
2016-09-30 16:04:53
Lance
This almost works, but for the fact it runs off 4 copies of each serial number. Help?
2016-09-30 10:14:06
Tina
I need to print multiple binders that consist of the same sheet (50 pages) in each binder. So I need to reset the numbering for each binder. How exactly do I do that?
2015-09-16 16:56:43
Frank Petermann
Brilliant, macro just saved the day as it's printing 700 sequential inspection sheets needed tomorrow morning!
Thanks much!
2015-08-11 11:48:36
Martin Steiner
Now I'm getting a message that while in debugger, it can't fine the project or Library and halts at "Format"
2015-08-11 11:22:50
Martin Steiner
Using Sequential Document Serial Numbers
updated May 16, 2015
I'm using Office 2010, win 7. I just cannot get this to work. The Serial bookmark works ok and I've tried many variation of adding and running the VBA scrip but no change in numbers and loads of paper with the same info one. After 6 hrs. I give up, how do I make this work?
2015-08-07 12:27:23
Matt Paulson
Hello!
How can I get the document to save it as a Word Document instead of a PDF? I need to run the Macro to get the new number and then send that sheet as a word document.
Thanks!
2015-06-16 16:19:16
Mike G
It seems that the serial is not moving up incrementally, as it only stays at "00001". How can I get the serial to change incrementally with each printing?
2015-05-19 17:18:29
Dennis Ralph
I have the same request but in Excel 2010.
I have to print out monthly pages of 1 - XX (depending on the amount of work load I encounter).
Is there a way to print out and number the pages sequentially without using the Header/Footer area? I have a cell at AQ4 that contains the page number. It's quite a waste of time to enter a number, print the page, increase the number be one, print that page, etc.
I have looked everywhere I can think of to attempt this feat! Even on ExcelTIPS!
Help would be muchly appreciated!
Cheers, Dennis
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2021 Sharon Parq Associates, Inc.
Comments