Welcome toWord.Tips.Net
Ask a Word Question
Make a Comment
Learn Access Now
Free Printable Forms
Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Legal Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips
Collapsing and Expanding Subdocuments
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 WordBasic macro, this is done with the NextCell and PrevCell statements, as shown here:
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
As you might expect, NextCell moves to the next cell, and PrevCell moves to the previous. 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 of the table is reached using PrevCell, the command has no further effect. When the end of the table is reached using NextCell, then Word adds a new row to the table and starts across again. If your WordBasic macro is left uncontrolled, NextCell could keep adding rows to your table until the cows come home. If you know how many cells are in the table, however, it can be very useful in inserting or checking information contained therein.
Tip #800 applies to Microsoft Word versions: 6 95
Create and Merge! Using Word's mail merge tool you can quickly and easily combine data from a variety of data sources to create great individualized documents that incorporate your data in ways that you control. WordTips: Mail Merge Magic is an invaluable source for learning how to harness the full power of Word's mail merging capabilities.