How to resize tables in Microsoft Word - with a Simple Developer Trick
Having trouble resizing tables in Microsoft Word, particularly when you have several tables in a document? Do not be concerned! You can save time and effort by using this simple method, which automatically resizes all tables to fit the window. Utilise a short Visual Basic script to follow this detailed tutorial.
Table of Contents
ToggleStep-by-Step Guide to Automatically Resize Tables
Step 1: Enable the Developer Option
Make sure the Developer tab is accessible in your Microsoft Word ribbon before we begin the trick.
- Go to File > Options > Customize Ribbon.
- Check the box next to Developer in the right-hand panel.
- Click OK to enable the Developer tab.
Step 2: Open the Visual Basic Editor
- Navigate to the Developer tab in the ribbon.
- Click on Visual Basic to open the editor.
Step 3: Insert a Module
- In the Visual Basic editor, go to Insert > Module.
- A blank module window will open.
Step 4: Paste the Script
Copy and paste the following code into the module window:
Sub Resizetables()
Dim tabl As Table
For Each tbl In ActiveDocument.Tables
tbl.AutofitBehavior wdAutoFitWindow
Next tbl
End Sub
Step 5: Run the Script
- Close the editor by clicking the X or return to the main Word window.
- In the ribbon, go to the Developer tab and click Macros.
- Select
Resizetables
from the list of macros and click Run.
What Happens Next?
After running the macro, all the tables in your document will automatically resize to fit the window. This ensures uniformity and saves time when dealing with multiple tables.