Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Merging rows (from a large number) by two
Hello,
I have a Microsoft Office Word 2007 table with two columns and many rows. In both columns, I'd like to merge rows by two (i.e., rows 1 and 2 together, rows 3 and 4 together, rows 5 and 6...) Is there an easy way to do this? Highlighting cells by two would take very long. Many thanks in advance, A. |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Merging rows (from a large number) by two
Hi Andrea,
Word doesn't actually let you merge whole rows in one swoop, only cells. This'll work, assuming the table is uniform (hasn't got any merged cells already) and has an even number of rows. It also assumes you want the cell pairs' content merged in a very ordinary way, with a pgph mark separating them. Sub MergeVerticalCellPairs() Dim d As Document, t As Table, i As Long, j As Long Set d = ActiveDocument Set t = Selection.Tables(1) For i = t.Rows.Count - 1 To 1 Step -2 For j = 1 To t.Columns.Count d.Range(t.Cell(i, j).Range.Start, t.Cell(i + 1, j).Range.End).Select Selection.Cells.Merge Next j Next i End Sub Hope this helps. Mark Tangard Word MVP 2001-2004 am wrote: Hello, I have a Microsoft Office Word 2007 table with two columns and many rows. In both columns, I'd like to merge rows by two (i.e., rows 1 and 2 together, rows 3 and 4 together, rows 5 and 6...) Is there an easy way to do this? Highlighting cells by two would take very long. Many thanks in advance, A. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
word hangs on formatting a large number of rows | Formatting Long Documents | |||
Merging multiple rows within column | Tables | |||
how to determine the number of rows in a large Word table? | Microsoft Word Help | |||
mail merging multiple columns with varying number of rows | Mailmerge | |||
Remove Rows from a Table after merging | Mailmerge |