PDA

View Full Version : Table cell address by string



markqqq
04-22-2013, 06:55 AM
Hi,

It is about Word Table VBA. I know we can do
Set myRange = myTable.Cell(1, 1).Range
but, how we can do something like
Set myRange = myTable.Cell("A1").Range
Set myRange = myTable.Cell("$A$1").Range

Thank you in advance.

fumei
04-22-2013, 11:24 AM
Well,
Set myRange = myTable.Cell(1, 1).Range

is kind of like
Set myRange = myTable.Cell("$A$1").Range

Sort of. But really, the second is Excel, and Excel is a different structure. It truly uses cells, and only cells. Word does not.

You can do a count of the cells, in order, with
Set MyRange = myTable.Range.Cells(6).Range

This sets the range for the sixth cell of the table.

What exactly is your problem?