![]() |
#1
|
|||
|
|||
![]()
I was looking for a macro on sequential Numbering and came across this code on one of the threads.
I would like to adapt this code by changing the input boxes to read from a userform text boxes, place it in a bookmark and also add the provision to print multiple copies of one document? Thankyou. Code:
Sub CertificatePrint() Dim iStart As Integer, iEnd As Integer, i As Integer, StrArry On Error GoTo ErrHandler iStart = CInt(InputBox("What is the first Certificate to print?", "Print Certificates From", "1")) iEnd = CInt(InputBox("What is the last Certificate to print?", "Print Certificates To", iStart)) If iStart = 0 Or iStart > iEnd Then Exit Sub With ActiveDocument For i = iStart To iEnd With .Shapes(1).TextFrame.TextRange.Fields(1) StrArry = Split(.Code.Text, " ") .Code.Text = Replace(.Code.Text, StrArry(UBound(StrArry)), i) .Update End With .PrintOut Next End With ErrHandler: End Sub Last edited by macropod; 03-17-2020 at 10:07 PM. Reason: Added code tags |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
gburya | Word VBA | 26 | 07-04-2017 03:29 PM |
Another Sequential Numbering Question (1,2,3a,3b,3c,4,5,6) | highrise955 | Word VBA | 4 | 03-21-2016 04:24 AM |
![]() |
RetailPoint | Word VBA | 14 | 01-14-2015 09:51 AM |
![]() |
im_rusahbh | Word VBA | 1 | 12-23-2013 05:28 PM |
![]() |
jdwoods | Word VBA | 7 | 12-16-2011 05:11 AM |