Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Moving Through a Table in a Macro.
by Allen Wyatt
(last updated July 10, 2018)
There may be times when you want to move the insertion point from cell to cell in a table. (Under the control of your macro, of course). If you are developing a VBA macro, this is done with the Move method, in the following manner:
Selection.Move Unit:=wdCell, Count:=1
In this case, the insertion point moves forward by one cell. If you want to instead move backward, just change the value used for Count:
Selection.Move Unit:=wdCell, Count:=-1
In either case, the insertion point moves to the beginning of the next or previous cell. When moving forward, the insertion point moves left to right, top to bottom through a table. If moving backward, the movement is from right to left, bottom to top. When the beginning or end of the table is reached, the command has no further effect.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (801) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Moving Through a Table in a Macro.
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!
When creating a macro, you may need to figure out how many fonts are available to Word. You can do this using the ...Discover More
Using a macro to format your document (or portions of your document) is not all that uncommon. If you want your macro to ...Discover More
Macros are often designed to be run on just a selected portion of a document. It is a good idea to make sure that the ...Discover More
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.