View Single Post
 
Old 08-16-2019, 02:31 PM
limdul9992 limdul9992 is offline Windows 10 Office 2010
Novice
 
Join Date: Jul 2019
Posts: 5
limdul9992 is on a distinguished road
Default Having Word print sequential serial numbers in a text field

Hi Everyone,

So I am have a code that I got for Excel to print the serial numbers sequentially but I am wondering what I would have to change in the code to work with a text field called Serialnumber to do the same as it does for Excel. Here is the code. I am not very good with VBA so that is why I am coming here for help.

ub PrintJobs()
Dim i As Long, startnum As Long, lastnum As Long

startnum = Application.InputBox("Enter the first job number to be printed", "Print Job Number", 1, , , , , 1)
lastnum = Application.InputBox("Enter the last job number to be printed", "Print Job Number", 1, , , , , 1)

For i = startnum To lastnum
Range("D7").Value = i
ActiveWindow.SelectedSheets.PrintOut
Next

End Sub
Reply With Quote