Deleting Word table rows

A

Alan

We have data in a table that we wish to dynamically delete
where the data is not relevant, therefore only leaving
completed lines in the table.
The first variable is easy as we know it will always be
the third row, but after that it depends what data is
present and how many rows have been deleted as to where
the next item on "the list" will be in the table.
The VB code searches for certain indicators and lands the
cursor in the correct cell already- is there a way to call
the row number of the cell it is in- or use an "active
row" style command?
 
P

Perry

The VB code searches for certain indicators and lands the
cursor in the correct cell already- is there a way to call
the row number of the cell it is in- or use an "active
row" style command?

If y're making use of the Selection object to move
the insertion point around:

Y'll find the statement y're looking for after the
immediate window print command in below examples.

Single cell selection and insertion point in row 4
? selection.Range.Rows(1).Index
4

Single cell selection and insertion point in row 1
? selection.Range.Rows(1).Index
1

Retrieving last row when selection covers multiple
rows, first collapse the selection object and then read out
your rownumber:
selection.Collapse wdcollapseend
? selection.Range.Rows(1).Index
4

Check out following statement in VBA.
selection.Information(wdWithInTable)
or
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbawd10/htm
l/woproinformation.asp

Krgrds,
Perry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top