Merging cells in column

G

Guest

Hello folks,

Can someone kindly help with vba code to do the following:

In a document with multiple tables, go through each column in each table
and,
Select the column
Merge all cells in that column.

Sergey
 
D

Doug Robbins - Word MVP

Use

Dim i As Long, j As Long
With ActiveDocument
For i = 1 To .Tables.Count
With .Tables(i)
For j = 1 To .Columns.Count
.Columns(j).Cells.Merge
Next j
End With
Next i
End With


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

Guest

It works.

Thank you.

Doug Robbins - Word MVP said:
Use

Dim i As Long, j As Long
With ActiveDocument
For i = 1 To .Tables.Count
With .Tables(i)
For j = 1 To .Columns.Count
.Columns(j).Cells.Merge
Next j
End With
Next i
End With


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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top