When programming in Word VBA to address tables, especially tables that have cells merged vertically or horizontally, it can be confusing to determine which cell is being addressed.
Take the following table:
Here you may wish to address the indicated cell. As the table has merged cells, you cannot address it with vba using its column and row position, but you can address it by cell number e.g.
Dim oTable As Table
Dim oCell As Range
Set oTable = ActiveDocument.Tables(1)
Set oCell = oTable.Range.Cells(n).Range
oCell.End = oCell.End - 1
where 'n' is the number of the cell. But what is that cell's number here?
This is where the add in comes in as it simply displays the cells by number and lists their contents with the selected cell highlighted.
That's simple, you may think, and so it is in the simple table above, but it gets altogether more complicated when working with forms that may contain many rows and columns randomly merged,
Thus the cell in question is number 5.
And that's really all there is to it.
The add-in puts a button on the context sensitive Table Layout tab of the ribbon
This simple add-in was developed to aid in the production of work I undertook for private clients.
Essentially it is a tool that identifies the cell number of a selected cell in a Word table for use in VBA programming. particularly where table cells have been merged, thus tending to confuse the cell numbering.