Posts

Showing posts from December, 2022

Microsoft Word Macro to Tidy Up All Tables

Image
Microsoft Word has capability to automatically arrange table's row width and column height. The reformatted tables are simply better than manual arrangement and it works on tables containing merged columns. I created Word macro below that will automatically reformat all tables in single macro execution. It resizes all cells' width and height to fit the content so the table takes least vertical space while maximizing available horizontal space. This makes the table contents are easier to be read. To create the macro, open View ribbon in Microsoft Word then click Macro > View Macro . Type TidyTable in Macro Name then click Create . Enter the macro code text below into the editor then Save and close the macro editor window. Sub TidyTable() Options.ReplaceSelection = True For Each aTable In ActiveDocument.Tables With aTable .TopPadding = InchesToPoints(0) .BottomPadding = InchesToPoints(0) .LeftPadding = InchesToPoints(0.03) .RightP...