#1
|
|||
|
|||
Cross Reference or VBA Editor to update while printing
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? |
#2
|
|||
|
|||
Uhm, when I do raffle tickets or other numbering of that sort, I use a SEQ field rather than a macro. For me, it is much easier.
https://support.office.com/en-us/art...rs=en-US&ad=US SEQuence Field Here's are videos on doing it using Mail Merge . https://www.youtube.com/watch?v=EmQTCKmqtmI https://www.youtube.com/watch?v=EmQTCKmqtmI This one works with the Raffle Ticket template available online. https://www.youtube.com/watch?v=pU2imaXpWPE (The mail merge methods look easier than the way I've been doing it.) |
Tags |
cross reference, raffle, vba |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
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 |
Cross-reference function to update bullet header and number simultaneously | dljenks | Word | 1 | 01-03-2014 01:38 PM |
Reference number and cross reference for equation numbers to match the thesis format | wmac | Word | 1 | 05-14-2013 08:54 PM |
Cross-reference in two lines!!!!! | Jamal NUMAN | Word | 3 | 04-12-2011 06:47 AM |