Tabbing from One Table to the Next

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


Dori Lynn's customers use Word to create simple forms. One of the things they do quite often is use tables for ease in moving through the form. Dori Lynn wonders if there is a way to tab from the last cell (field) of one table to the first cell in the next. Right now if she tabs at the end of the table, it creates a new row.

Pressing the Tab key when the insertion point is in a table cell normally moves the selection to the next cell in the table. At the last cell in the table, the Tab key adds a new row of cells to the bottom of the table and moves the insertion point to the first cell of the new row. That is obviously not the behavior that Dori Lynn is looking for.

There are a couple of approaches you can use for this problem. One approach, which is available only if you are using Word 2007 or Word 2010, is to remember that you can use the Object Browser to move from one table to the next. (The Object Browser was removed with the introduction of Word 2013.) That, of course, means that you can't use the Tab key to move from table to table, but you can click the Object Browser button (bottom-right corner of the screen, click the small "ball" between the double up- and down-arrows, then choose Browse by Table from the options) to find those tables.

If you actually want to use the Tab key, then you are going to need to create a macro. Pressing the Tab key when the insertion point is within a table causes Word to execute a command called nextcell, which in turn executes the MoveRight command. It is possible to write a custom nextcell command that forces Word to do what Dori Lynn wants.

How you modify existing Word commands is covered in other WordTips. The custom nextcell routine, below, traps the Tab key and moves the selection to the next cell unless the current cell is the last cell of the table. If it is, then it moves to the next table in the document. If there are no further tables in the document, then the insertion point remains in the last cell of that last table.

Sub nextcell()
    Dim oCell As Cell

    With Selection
        Set oCell = .Cells(1).Next
        If oCell Is Nothing Then
            .Move unit:=wdTable, Count:=1
        Else
            .MoveRight Unit:=wdCell
        End If
    End With
End Sub 

The subroutine will work correctly with tables that have vertically and horizontally merged cells. It will process tables within tables, but will stop at the last cell of the inner table.

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 (5673) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021.

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

Searching for Text With a Certain Format

The Find and Replace tool in Word is very powerful. You can use it to search not only for text but for the formatting ...

Discover More

Creating a Normal Index

Adding an index to a document is an easy task. There are a couple of ways you can do it, as described in this tip.

Discover More

Saving Changes in the Personal Workbook

The Personal workbook is a special place used to store information and macros that you can access from all the other ...

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)

Unwanted Numbering on Pasted Tables

When pasting text from another document or from the Web you can have unexpected characters sometimes show up. Many of ...

Discover More

Splitting a Table

Table getting too long? Need to move part of a table to somewhere else in your document? You can easily split an existing ...

Discover More

Hiding Gridlines

For those times when you remove the borders from your tables, Word provides a way that you can display non-printing ...

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 2 + 2?

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.