Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #14  
Old 09-26-2015, 04:21 AM
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,523
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'm experiencing some minor issues when I run this code:
- The tables as a whole are left aligned, then some are halfway off the left side. How could you make them centered in the page?
When I ran it, the macro centred the tables on the page.
Quote:
- When I try to add code to repeat the first row, I get an error again about merged cells. Is it a matter of where it is placed in the code or how? I've been trying this code:
Code:
Tbl.Rows(1).HeadingFormat = True
You can't do that in a table with vertically-merged cells. The simplest way around that is to select a cell on that row and use the selection to apply the heading format.
Quote:
- The table gets messed up when it comes across unmerged cells in column 1 (for obvious reasons), which can happen often with these documents. Could there be a check added to see if the cells are merged first and to merge them if they are not? I am thinking something like this (I know this isn't correct, but I'm still learning):
Code:
If Case 1: .Cells.Merge = False Then
            .Cells.Merge
            Else Next
What you need to do here is to test whether the 5th cell in the group is in column 1; it shouldn't be. If it is, use the selection process again to merge the column1 cells
Quote:
- I'd like the horizontally merged cells to be a set height, but still be able to expand if too much content is added (AutoFit I think). My first attempt was with the following code, but it didn't seem to do anything.
Code:
If .Cells().Width = InchesToPoints(6.21) Then
                    .Cells.Height = InchesToPoints(0.8)
                End If
The way to do that is via the SetHeight method.

I've incorporated the above, plus comments into the code in my previous post.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

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 01:38 PM.


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