![]() |
|
#1
|
|||
|
|||
![]()
When splitting cells manually Word 2016 seems to know about its context and will offer set values depending on other merging/splitting within the table that intersect the cell.
Is it possible to access this functionality using the split command or am I just being too hopeful. For example if I am splitting a cell and the column to the left has two rows equivalent to my selected cell and the the column to the right has eight cells the when I click the up arrow for the number of cells I will be offered 2, 4, 8 for successive clicks. An alternative would be a pointer to a macro that can take a table with vertiically and horizontally merged cells and return the table to a 'uniform' status. Or am I in for another loooong night? In case you are wondering I have numerous tables in a document to update and the previous author has kindly merged cells rather than turning the cell borders off and my updates are in the merged areas. |
#2
|
|||
|
|||
![]()
I have been working to create a routine to format some tables with a specified number of beginning rows with .HeadingFormat to make them repeat on each page. That resulted in the fact that tables with any cells merged (mergers) vertically, the row object references are not valid. The rows must be split before using VBA to process them.
I have developed a very nice set of routines for determining if a cell is a merger (vert., horiz. or both) and can also give the user a list (cells for vert. and rows for horiz.). Arrays are used to save the rows and cells with mergers. The arrays were intended to be used to split the cells (vert. mergers only) and remerge them after processing my table formatting. However, I think I have encountered a bug. Some vert. merged cells cannot be split depending on the surrounding/adjacent merging. Also, when attempting to trap the error, sometimes it works and sometime not. And, I think that some cells can't be split is also a bug. Selecting the cell, manually, and performing the split from the ribbon command works fine. When, the error is untrappable, VBA simply displays the error description and won't branch to the On Error label and stops. The only way to practically demonstrate this problem is to let you try it with my project file, attached. Please remember, not everyone writes scripting the same way. I like everything as I have it except for the error trapping discrepancy when attempting to split a cell and help with that would be appreciated. I have seen a lot of forum discussions about similar attempts to identify mergers and I have a very good one, I think. My apologies for being so verbose. |
#3
|
|||
|
|||
![]()
Thanks for taking the time to post, but its now five years later and I'm afraid I've moved on. I took a quick look at your code and it does appear to contain some errors. If you haven't yet discovered it, then Rubberduck for VBA is a fantastic and free addin for VBA which helps to significantly improve the robustness and quality of VBx code.
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
slicer: OR functionality problem... | denpries | Excel | 0 | 01-23-2017 12:33 AM |
![]() |
elmousa68 | Word VBA | 3 | 01-09-2014 01:55 AM |
![]() |
amlong | Word VBA | 7 | 02-22-2013 11:34 PM |
![]() |
Karen615 | Excel | 3 | 09-20-2011 06:36 AM |
![]() |
markg2 | Word | 1 | 01-13-2011 02:17 PM |