View Single Post
 
Old 02-09-2021, 09:30 PM
Wild Bee Wild Bee is offline Windows 10 Office 2019
Novice
 
Join Date: Feb 2021
Posts: 7
Wild Bee is on a distinguished road
Default Macro to change each individual cell to 0 padding, one at a time in a table with merged cells.

Hi.

I have scoured the net for days now, and even though I've found a couple of macros that work when the table has no merged cells, or does the whole document, I haven't found a macro that will check each cell in a table and change it's margins/padding.

I've discovered that for Word, each individual cell in the table has it's own margins, which overrule any changes to the table as a whole. The only way I can remove all white space from within a table, is to click on each cell and change it's margins to 0, or tick the box that says "same as whole table". Selecting the whole table and changing these numbers does diddly-squat to the individual cells.

I've done a simple macro that I can run manually for each cell, but I am converting documents that have anything from 200 pages to 700 pages of tables. The tables are specialized in this business (Aviation), so they MUST remain exactly as they already are when it comes to shape, borders and size. I will control the space around the text using paragraph formatting.

I can sort of decipher and "read" macro's, but am not that familiar with VBA, so would really appreciate if someone could please write me a VBA that will check each cell within a selected table, regardless if merged, and change the margin/padding to 0.

Thanks.
Reply With Quote