Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-24-2015, 09:09 PM
CodingGuruInTraining CodingGuruInTraining is offline Combining 2 tables into 1 and use Table2's column widths (hoping for workaround dealing merged cells Windows Vista Combining 2 tables into 1 and use Table2's column widths (hoping for workaround dealing merged cells Office 2010 32bit
Novice
Combining 2 tables into 1 and use Table2's column widths (hoping for workaround dealing merged cells
 
Join Date: Sep 2015
Posts: 13
CodingGuruInTraining is on a distinguished road
Default



Quote:
The basic table's creation (i.e. header row plus the two rows below that) is only part of what the code does. It then has to replicate as many of the non-header rows as are necessary to match the original table. An alternative, if your existing tables (which I haven't seen) were suitable, would be to forego creating a new table and just re-format the existing ones.
I was referring to my original strategy, although I was doubtful whether such a method was possible. Unfortunately, the merged cells prevent formatting the current tables unless there is a workaround that I have not come across yet. If this way works, then that is all that matters really.

I tried your code yesterday and it worked great on the tables, but it seems to paste over 5-6 lines of text inbetween tables. I am still trying to figure out how your code works, but I'm wondering if this issue has something to do with the following part:
Code:
With .Range.Paragraphs.Last.Next.Range
            .InsertBefore vbCr
In one affected part I removed an extra line and then ran the code, which removed all remaining text (more than the 5-6 lines) between these 2 tables.
In another part, removing an indent/tab on a line under a table removed 2 more lines than before. I am still playing around with other causes, but hopefully you know more about this cause than I do.
Reply With Quote
  #2  
Old 09-24-2015, 09:42 PM
macropod's Avatar
macropod macropod is offline Combining 2 tables into 1 and use Table2's column widths (hoping for workaround dealing merged cells Windows 7 64bit Combining 2 tables into 1 and use Table2's column widths (hoping for workaround dealing merged cells Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Quote:
Originally Posted by CodingGuruInTraining View Post
I was referring to my original strategy, although I was doubtful whether such a method was possible. Unfortunately, the merged cells prevent formatting the current tables unless there is a workaround that I have not come across yet. If this way works, then that is all that matters really.
Sure it's possible to reformat tables with merged cells and doing so would obviate all the circumlocution the current approach will require. But, without seeing some representative sample tables (even without data), I don't know what the better course is. Hint...
Quote:
Originally Posted by CodingGuruInTraining View Post
I tried your code yesterday and it worked great on the tables, but it seems to paste over 5-6 lines of text inbetween tables.
That's because I took the precaution of inserting extra blank paragraphs in case there were consecutive tables in the document - you wouldn't want them getting joined up. Any redundant empty paragraphs can be cleaned up later.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 09-25-2015, 05:58 PM
CodingGuruInTraining CodingGuruInTraining is offline Combining 2 tables into 1 and use Table2's column widths (hoping for workaround dealing merged cells Windows Vista Combining 2 tables into 1 and use Table2's column widths (hoping for workaround dealing merged cells Office 2010 32bit
Novice
Combining 2 tables into 1 and use Table2's column widths (hoping for workaround dealing merged cells
 
Join Date: Sep 2015
Posts: 13
CodingGuruInTraining is on a distinguished road
Default

That is good to hear! I think a sample might help so I put one together and attached it here. Hopefully it provides what you need.
Attached Files
File Type: docx Sample Document.docx (54.6 KB, 12 views)
Reply With Quote
Reply

Tags
column width, combine, tables



Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining 2 tables into 1 and use Table2's column widths (hoping for workaround dealing merged cells Table will not allow sorting because "cells are merged". I can't find the merged cells. wendyloooo Word Tables 1 05-26-2015 01:19 PM
Splitting one column into two with two different widths officeboy09 Excel 6 12-15-2013 09:48 PM
Pasting tables from Excel 2010 into Word 2010 - How to fix column widths? GracieB Word 7 10-02-2013 06:24 AM
Adjusting column widths norwood Word VBA 0 09-24-2013 06:53 AM
Combining 2 tables into 1 and use Table2's column widths (hoping for workaround dealing merged cells VBA code to fix column widths molesy Excel 3 09-16-2013 12:51 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:50 AM.


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