1. Horizontally merged cells

Guys I have searched high and low and cannot find any information on unmerging horizontally merged cells in a word table. Unmerging vertically works can unmerging horizontally?

http://www.vbaexpress.com/forum/show...y-merged-cells

2. You need to understand that, depsite what appears to work in your other thread, Word cannot tell whether a cell has been merged with another cell or whether what appears to be a merged cell is the result of other cells being split - vertically and/or horizontally.

All the code you're now using does is to assume any differences in vertical heights are due to vertical merges; the possibility of the vertical splitting of adjoining cells isn't even considered.

For potential horizontal splits/merges, things are even more complicated, as the cells in a given column can have different widths without any splitting or merging being a factor.

Originally Posted by macropod
For potential horizontal splits/merges, things are even more complicated, as the cells in a given column can have different widths without any splitting or merging being a factor.
so since my table has exact column widths:
``` With oTbl
.Columns(1).SetWidth ColumnWidth:=60, _
.Columns(2).SetWidth ColumnWidth:=200, _
.Columns(3).SetWidth ColumnWidth:=200, _
.Columns(4).SetWidth ColumnWidth:=60, _

It may possible?

4. So, if all the columns have pre-set widths, how can any of the cells be merged or split? Code such as you posted would not work on a table with horizontally merged/split cells.

5. That is the code that creates the table. it cannot be used to reset the column widths after any cells are merged. I was just showing you that the columns should have a specific width. I was thinking...is it possible to split a cell that is the width of a combination of 2, 3, or 4 cells based on the above widths? so if a cell ColumnWidth:=260 or 400 or 460 or 520 then split? so if it was 260 or 400 split in two if its 460 split in three if its 520 split in 4? Just a thought.

6. Consider the case where the user drags the right border of a cell in your 2nd column 60pt to the right. It's now 260pt wide, but nothing's been split or merged. Moreover, the corresponding cell in the 3rd column is now only 140pt wide. If such a scenario is possible, you might use:
oTbl.Columns.DistributeWidth
before resetting their widths. Other than that, you'd need to loop though all cells, finding which rows have fewer than 4 cells, then choosing one (or more) to split before using Columns.DistributeWidth, etc.

7. Paul thanks for the discussion. I think I have a starting point. I will post when I get started.

8. I just had a forced Microsoft update and lost all macros for the last 3 months. If I bother to replace them. I'll reopen the thread and post results. What a disappointment. Second time this has happened.

9. That suggests you're working in a corporate environment and your IT department kindly overwrote your Normal.dotm file - in which you were storing your macros. Next time, store them in a different template and keep a backup.

10. Thanks for the advice. I think you said the same thing last time. LOL. IT guy here is a knob. He can't stand that I write macros. He says it's his job but the stuff I'm doing is above his knowledge.

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•