#1
|
|||
|
|||
Sequential Numbering
I found a macro from the thread Titled "How do I do a sequential number?" and when tired to format it to a word document that i was making i can not seem to get it to work like the way I thought it would work, even the text boxes will not work but when i run the macro i don't get any errors. I have included the file to see if anyone could help me out. All I want is the macro to do is to change the numbering on top of the page every time a print a new page or the i can print 1 to 500 pages and that the number sequence will be displayed on the top of the page.
|
#2
|
||||
|
||||
Hi jdwoods,
There's no macro in your document (it's in docx format), so it's hard to see what the issue might be. Perhaps you could post one with the code.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Code:
Option Explicit Sub ElevatorInventoryControlTicket() Dim iStart As Integer, iEnd As Integer, i As Integer On Error GoTo ErrHandler With ActiveDocument.Shapes(1).TextFrame.TextRange.Fields(1) iStart = CInt(InputBox("What is the first certificate to print?", "Print Certificates From", Split(Split(.Code.Text, "")(0), "=")(1))) iEnd = CInt(InputBox("What is the last Certificate to print?", "Print Certificates To", iStart)) If iStart = 0 Or iStart > iEnd Then Exit Sub For i = iStart To iEnd .Code.Text = "=" & i & " \#0" .Update ActiveDocument.PrintOut Next End With ErrHandler: End Sub |
#4
|
||||
|
||||
Hi jdwoods,
Because your document has two textboxes, and the one with the counter was inserted last, you need to change 'Shapes(1)' to 'Shapes(2)'. You also need to change '.Code.Text, ""' to '.Code.Text, " "'.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
I do not see the difference between 'code.text,"" to 'Code.text, "". if the period is suppose to follow the brackets on the second one then i get an error.
|
#6
|
||||
|
||||
That's because you're not paying attention to the space between the double quotes.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
I tired rewriting the whole marco in a new file and still can not get the input boxes to appear and therefore the ticket number does not change not sure what am doing wrong. Could it be the verision of word i am using or am i missing a simple step when i am running the macro.
|
#8
|
||||
|
||||
Hi jdwoods,
See the attached.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sequential numbering across multiple docs | mslearner | Word | 18 | 06-12-2019 04:00 AM |
How do I do a Sequential Numbering? | gburya | Word VBA | 26 | 07-04-2017 03:29 PM |
Sequential Page Numbering of Multiple Word Docs | bobmard | Word | 8 | 08-24-2011 08:51 AM |
Sequential Presentations | GSmoot | PowerPoint | 0 | 07-12-2011 11:20 AM |
Subtotaling Sequential 0's | ktpalmer | Excel | 2 | 06-23-2010 06:54 AM |