X

How To Adjust The Width And Height Of All Tables In A Word Document?

In today’s tutorial, the author would like to share with you guys the fastest way to adjust the width and height of tables in a Word document.

Let’s take an example. There are four tables of different sizes, and we need to adjust them to the same size quickly.

Go to the Developer tab and choose Visual Basic.

Insert a module first, then type this code in the box. (You can just copy and paste)

Sub Selectallthetables()

Dim tempTable As Table

Application.ScreenUpdating = False

If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then

MsgBox “The document is protected. Multiple tables cannot be selected at this time!”

Exit Sub

End If

ActiveDocument.DeleteAllEditableRanges wdEditorEveryone

For Each tempTable In ActiveDocument.Tables

tempTable.Range.Editors.Add wdEditorEveryone

Next

ActiveDocument.SelectAllEditableRanges wdEditorEveryone

ActiveDocument.DeleteAllEditableRanges wdEditorEveryone

Application.ScreenUpdating = True

End Sub

Then we click on the green triangle to run the code.

After you run the code. You will notice that all the tables in the Word document are selected. Go to the Layout and choose Properties.

You can adjust the tables’ size in bulk here.

Now, all the tables are changed into the same size.

Categories: Word Tips
Sandra: