Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-24-2016, 01:14 PM
npalmer610 npalmer610 is offline Merge Table Rows Windows 7 64bit Merge Table Rows Office 2010 64bit
Novice
Merge Table Rows
 
Join Date: Feb 2016
Posts: 5
npalmer610 is on a distinguished road
Default Merge Table Rows

Hello. I have a similar problem to https://www.msofficeforums.com/word-...row-table.html. However, I do not need to merge specific rows. I am hoping, as this thread suggested, to merge each cell, row by row, regardless of how many columns, or how many tables. The current macro posted—which was very helpful—only merges a single table with those specific parameters. What I am hoping for is a similar macro that will loop through the entire document and any time it finds a table with multiple columns, it will combine it to a single column, while keeping each row intact. Thank you for your help in advance!
Reply With Quote
  #2  
Old 02-24-2016, 01:42 PM
macropod's Avatar
macropod macropod is offline Merge Table Rows Windows 7 64bit Merge Table Rows Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
Code:
Sub MergeAllTableRows()
Dim Tbl As Table, TblRw As Row
For Each Tbl In ActiveDocument.Tables
  For Each TblRw In Tbl.Rows
    TblRw.Range.Cells.Merge
  Next
Next
End Sub
PS: Please don't resurrect old threads. I've split your post off to a new one, with a link back to the old one.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 02-24-2016, 04:44 PM
npalmer610 npalmer610 is offline Merge Table Rows Windows 7 64bit Merge Table Rows Office 2010 64bit
Novice
Merge Table Rows
 
Join Date: Feb 2016
Posts: 5
npalmer610 is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Try:
Code:
Sub MergeAllTableRows()
Dim Tbl As Table, TblRw As Row
For Each Tbl In ActiveDocument.Tables
  For Each TblRw In Tbl.Rows
    TblRw.Range.Cells.Merge
  Next
Next
End Sub
PS: Please don't resurrect old threads. I've split your post off to a new one, with a link back to the old one.
Sorry and many thanks!!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge Table Rows Mail Merge to create specific number of table rows flackend Mail Merge 4 12-01-2023 02:49 PM
Merge Table Rows Mail merge at large table with variable number of rows blar Mail Merge 1 10-19-2015 03:04 PM
Merge Table Rows Mail merge into table with two colums and several rows kathriiin Mail Merge 3 03-30-2015 07:06 AM
Merge Table Rows Is it possible to copy non-contiguous rows of a Table and paste them as a separate Table in Word? Joey Cheung Word Tables 1 08-12-2014 05:15 PM
Merge Table Rows Grouping table rows to prevent individual rows from breaking across pages dennist77 Word 1 10-29-2013 11:39 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:16 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft