#1
|
|||
|
|||
moving around a table
Is there a way to move to a specific cell in a table ?
For example, I need to move to the centre cell in a table. Currently, I use the Selection.MoveDown, MoveRight ect... commands. But, I need to keep track of my move counts. Is there a way move to a cell designation (A1, B1 etc...) for example ? Thanks ! |
#2
|
|||
|
|||
You can use
selection.Tables(1).cells(x,y) to select a cell. You need to be careful if the table contains merged or split cells because the maximum X and Y are based on the maximum number of rows and columns. This aspect of tables in word macros is a real PITA. |
#3
|
|||
|
|||
Great, Thanks !
|
#4
|
|||
|
|||
It also depends on how often you need to do this. If it is something you regularly need to do with a specific table cell, then you could simply declare that cell as an object and then go to it with one instruction.
I could also add that it is very possible that you do not need to go to it at all. VBA makes it easy to action any given cell without ever putting the Selection there. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Moving sum | dmrj78 | Excel | 3 | 10-29-2012 12:34 PM |
moving one task from one row to another | ketanco | Project | 3 | 12-26-2011 09:29 AM |
Moving Messages | iflog | Outlook | 2 | 08-19-2011 01:30 PM |
Moving formula range multiple cells when moving sum over one cell | FraserKitchell | Excel | 4 | 02-26-2010 10:38 AM |
Table rows moving to new page when you don't want them to | graham | Word Tables | 1 | 11-16-2009 08:51 AM |