I'm trying to set an integer variable = to the Column.Index number for a particular cell in a given table. The row x column location of the selected cell is NOT however known to the macro. The column object seems to only be available under the Cell(RxC) parent, but the Cell(RxC) is unknown in my case.
I have several tables in a DOC that have a merged cells in the bottom row(s). The number of these merged cell rows is not set. In the macro, I am moving around in the table doing various things, and at some point I need to know what column I'm in. And, due to the merged cells at the bottom, the Cell(RxC) position can get lost.
So, I was hoping that the Column.Index property would give me my location, but I can't seem to determine the correct code structure. HELP!
The following is close, but w/o the Cell(RxC) it won't compile.
Column_Num = Selection.Table(1).Range.Cell().Column.Index
Last edited by sauerj; 09-17-2010 at 09:26 AM. Reason: Andy Pope SOLVED this & my other Word Programming Question
What do you mean by a 'table'?
There is no 'Table' object in the Excel Object model, not that I can find anyway.
Though there does appear to be methods/properties/objects things like TableStyle which according to
some resources are for pivot tables, and others tables (including pivot tables) ???
The only other tables I can think of are QueryTables, DataTables.
There's even a LocationInTable property for ranges which is apparently for pivot tables.
It's a Word related issue.
With Selection If .Information(wdWithInTable) Then MsgBox "Active Row=" & .Information(wdStartOfRangeRowNumber) & vbLf & _ "Active Column=" & .Information(wdStartOfRangeColumnNumber), vbInformation End If End With
Wow! Big HELP! ... SOLVED and merit given!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks