Setting a Standard Column Width

Written by Allen Wyatt (last updated October 30, 2023)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


Liz has several documents, each with multiple tables containing content. These tables are simple two-column tables with varying numbers of rows. Currently, the column widths of the tables vary depending on the content. Liz wants all the tables to have the same column widths (for example, 5.25" for the first column and 1.25" for the second column). She wonders if there is a way to accomplish this other than setting the column widths for each table one at a time.

If, as Liz describes, these are existing documents that contain a bunch of tables, then the only way to accomplish this task is to use a macro. The technique to use has actually been described in a different WordTip, which you can find here:

https://wordribbon.tips.net/T011693

While the technique described in that tip is applicable to Liz's situation, it can be made even more applicable by simply making a few changes. For instance, Liz indicates that all of the tables have two columns. However, if there is (for some reason) a table or two that have a different number of columns, a macro that expects two columns could play havoc with these other tables. Consider this macro, which simply skips any table that has a different number of columns:

Sub SetTableWidths()
    Dim t As Table
    Dim iFixed As Integer
    Dim iSkipped As Integer
    Dim sTemp As String

    iFixed = 0
    iSkipped = 0
    For Each t In ActiveDocument.Tables
        If t.Columns.Count = 2 Then
            t.Columns(1).Width = InchesToPoints(5.25)
            t.Columns(2).Width = InchesToPoints(1.25)
            iFixed = iFixed + 1
        Else
            iSkipped = iSkipped + 1
        End If
    Next t
    sTemp = "Tables Fixed: " & iFixed & vbCr
    sTemp = sTemp & "Tables Skipped: " & iSkipped
    MsgBox sTemp
End Sub

When you run the macro, it adjusts the width of all two-column tables in the document. When completed, it shows the number of tables that were fixed (the number of two-column tables) and the number of tables that were skipped (those that had fewer or more columns than two).

This macro-based approach works great for documents that already have tables in them. If you are creating new documents, though, you should consider creating a "standard" table and store it as a Building Block. This makes it very easy to put such a table in your document as you are developing it. The way you do this is covered in a different WordTip:

https://wordribbon.tips.net/T006076

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13749) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Changing Color in WordArt

You can make your document flashier by using WordArt to punch it up. Here's how you can change the color of the text in ...

Discover More

Keep Your Headings in View

Headings on a table are very important when it comes to understanding what is in the table. This tip explains an easy way ...

Discover More

Referencing the Last Six Items in a Formula

If you have a list of data in a column, you may want to determine an average of whatever the last few items are in the ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (ribbon)

Filling Table Cells with a Macro

Want to stuff a value into each cell of a table? You can either type the value over and over and over again, or you can ...

Discover More

Using Outline Numbering in a Table

Can you put a numbered outline in a table? Yes, you can. But Word is rather prickly when it comes to using the keyboard ...

Discover More

Cannot Set Heading Rows in a Table

Word allows you to specify which rows in a table should be considered headings. What if setting the headings doesn't work ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is four minus 0?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.