![]() |
#1
|
|||
|
|||
![]()
So I am able to use this formula
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 to auto number a document that I am doing. I am making raffle tickets that will be torn apart into two pieces. Top copy as the receipt, bottom portion will be the actual ticket. I have my document set to update on the top and I want it to update on the bottom as well when I print. I have tried to redo the code for the bottom portion or use cross reference and neither option seems to work. Any idea? |
Tags |
cross reference, raffle, vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cross reference at different levels | jineu21 | Word | 6 | 03-20-2017 05:34 AM |
Cross reference is bad. | Leffken | Word | 1 | 06-09-2016 03:12 PM |
![]() |
dljenks | Word | 1 | 01-03-2014 01:38 PM |
![]() |
wmac | Word | 1 | 05-14-2013 08:54 PM |
![]() |
Jamal NUMAN | Word | 3 | 04-12-2011 06:47 AM |