View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP on news.microsoft.com Doug Robbins - Word MVP on news.microsoft.com is offline
external usenet poster
 
Posts: 407
Default mail merge reserved tickets

I assume that you mean

A1, A2, ...An
B1, B2,...Bn
etc.

Simplest way would be to put

A in the first cell of the second row i,e, Cell A2 (the first row being for
field names) and 1 in the second cell of the second row (i.e. Cell B2, then
in the first cell of the third row Cell A3 , put the formula = A2 and in
cell B3 put the formula = B2 + 1. Then copy Cells A3:B3 down as many rows
as required to until you get to An.

Then select the range A2:Bn+1 and paste it below as many times as you have
rows, and then go and change the A to B in the first row where the number
reverts to 1 and likewise for the rest of the rows of data.

However, if you run a macro containing the following code when you have a
blank document as the active document in Word, it will create a table in
that document that can be used as the data source
Sub MakeTicketData()
Dim rows As Long, seats As Long, i As Long, j As Long
Dim datatable As Table
Dim datarow As Row
rows = InputBox("Enter the number of rows.", "Rows")
seats = InputBox("Enter the number of seats.", "Seats")
Set datatable = ActiveDocument.Tables.Add(Selection.Range, 1, 2)
datatable.Cell(1, 1).Range.Text = "Row"
datatable.Cell(1, 2).Range.Text = "Seat"
If rows 27 Then
For i = 1 To rows
For j = 1 To seats
Set datarow = datatable.rows.Add
datarow.Cells(1).Range.Text = Chr(64 + i)
datarow.Cells(2).Range.Text = j
Next j
Next i
Else
For i = 1 To 26
For j = 1 To seats
Set datarow = datatable.rows.Add
datarow.Cells(1).Range.Text = Chr(64 + i)
datarow.Cells(2).Range.Text = j
Next j
Next i
For i = 27 To rows
For j = 1 To seats
Set datarow = datatable.rows.Add
datarow.Cells(1).Range.Text = "A" & Chr(38 + i)
datarow.Cells(2).Range.Text = j
Next j
Next i
End If
End Sub

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"Heartland" wrote in message
...
I'm trying to set up a mail merge to print reserves seating on event
tickets.
Suggestions on setting up the Excel data for repeating seat numbers by
seat
row needed?