View Single Post
  #3   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Merge columns not rows

Use a macro containing the following code:

Dim i As Long, j As Long
Dim element As Range
Dim address As String
With Selection.Tables(1)
For i = 1 To .Rows.Count
address = ""
For j = 1 To 3
Set element = .Cell(i, j).Range
element.End = element.End - 1
address = address & element.Text & vbCr
Next j
Set element = .Cell(i, 4).Range
element.End = element.End - 1
address = address & vbCr
.Cell(i, 1).Range.Text = address
Next i
For i = 4 To 3 Step -1
.Columns(i).Delete
End With

Or use a Directory type mail merge with your existing table as the
datasource and in the mail merge main document, insert a one cell table and
into that cell, insert the field names of the 4 columns in the configuration
that you want and then execute the merge to a new document.

--
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

"Microchip" wrote in message
...
I have a large table (160 pages) where I want to combine four (address)
columns into one. Word doed exactly that one cell containing 4 columns
and
160 rows of data. How can I merge the four columns in each row without
doing
it row by row?

Thanks