How to resize tables in Microsoft Word

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.

VBA script to resize Word tables

Step-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.

  1. Go to File > Options > Customize Ribbon.
  2. Check the box next to Developer in the right-hand panel.
  3. Click OK to enable the Developer tab.

Step 2: Open the Visual Basic Editor

  1. Navigate to the Developer tab in the ribbon.
  2. Click on Visual Basic to open the editor.

Step 3: Insert a Module

  1. In the Visual Basic editor, go to Insert > Module.
  2. 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.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top