Displaying a Column Number

Written by Allen Wyatt (last updated May 31, 2024)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


Deena has a document that is formatted to use three columns. She would like a way to display and print, automatically, a column number at the top of each column. Thus, the columns on page 1 would be numbered 1 through 3, those on page 2 would be 4 through 6, etc.

There is no way to do this automatically, but a workaround is to create a macro that will print the document with column numbers in the page header. All you need to do is make sure that the header has tab stops set to match where you want the column numbers to appear.

Sub ColumnHeaders()
    Dim p As Long
    Dim tp As Long
    Dim c As Integer
    Dim tc As Integer
    Dim h As String
    Dim ch As String

    ' Get total pages
    tp = ActiveDocument.Content.ComputeStatistics(wdStatisticPages)
    ' Get number of columns
    tc = ActiveDocument.Sections(1).PageSetup.TextColumns.Count
    ' Save current header
    ch = ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Text

    For p = 1 To tp
        h = ""
        For c = 1 To tc
            h = h & Trim(Str(p + (c - 1) + (2 * p - 2))) & vbTab
        Next c
        h = Left(h, Len(h) - 1)
        ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Text = h
        ActiveDocument.PrintOut Range:=wdPrintFromTo, _
          From:=Trim(Str(p)), To:=Trim(Str(p))
    Next p
    
    If Len(ch) > 1 Then
        ' Restore previous header
        ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Text = ch
    Else
        ' There is no previous header
        ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Delete
    End If
End Sub

The macro actually prints out each page of the document individually. It assumes there is only a single section in the document. The number of columns for that single section is determined, and then this count is used in putting together the header for each page. The header consists of the column numbers separated by tabs. The header is constructed for each page, and then each page is printed.

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 (12826) 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

Inserting a Non-Breaking Hyphen

Non-breaking hyphens can come in helpful for some types of writing. They force the words (or characters) on both sides of ...

Discover More

Controlling Automatic Backups

Excel can make backups whenever you save your workbook. If you want to turn the feature on or off, this tip explains how ...

Discover More

Changing the Height of a Font

Scaling the width of a font is easy to do with Word's formatting capabilities. Scaling the height of the fonts is not so ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (ribbon)

Setting Up Multi-page Columns

Do you need a page layout that features columns that progress vertically across pages instead of horizontally across a ...

Discover More

Determining a Column Width

When laying out your document, you may wonder what width you should use for your text. An old typographers’ trick may ...

Discover More

Disappearing Column Formatting

Two things go into making your documents look just right: content and formatting. If the formatting seems to disappear on ...

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 nine minus 9?

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.