chad201008
asked on
numbering raffle tickets in word
I want to make a raffle ticket template in word. I want to print out 4000 tickets, 8 per sheet, making it 500 sheets of paper. I want them to be numbered down the column of tickets. So, the top left raffle ticket would be number 1, then on the second sheet the top left raffle ticket would be number 2 and so on till the last sheet top left raffle ticket would be number 500. Then the top right raffle ticket would be number 501 and so on. The first sheet would have numbers 1,501,1001,1501,2001,2501, 3001,3501.
ASKER
this works great but can you breakdown the macro so that i can tweek it if i need. thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sub CreateRaffleTickets()
Dim tbl As Table
Dim doc As Document
Dim rng As Range
Dim r As Integer
Dim t As Integer
Dim b As Integer
Dim cl As Cell
Set doc = Documents.Add
For t = 1 To 500
r = t
Set rng = doc.Bookmarks("\EndOfDoc")
Set tbl = doc.Tables.Add(rng, 4, 2)
tbl.AllowAutoFit = False
tbl.Columns.Width = CentimetersToPoints(6)
tbl.Rows.Height = CentimetersToPoints(6)
For b = -6 To -1
tbl.Borders(b).LineStyle = wdLineStyleSingle
Next b
For Each cl In tbl.Range.Cells
cl.Range.Text = "Raffle ticket number: " & r
r = r + 500
Next cl
Set rng = doc.Bookmarks("\EndOfDoc")
rng.InsertParagraph
Set rng = doc.Bookmarks("\EndOfDoc")
rng.InsertBreak wdPageBreak
Next t
End Sub