Get a value from a Table

T

Tim

Hey All,

I have a table that is 5 columns wide by x rows long and would like to get
the string out of the cell which can be the intersection of any row between 2
and x and the first column. Thank you very much.

Tim
 
D

Doug Robbins - Word MVP

Dim myrange as Range
Dim i as Long
Set myrange ActiveDocument.Tables(1).Cell(i, 1).Range
myrange.End = myrange.End - 1
MsgBox myrange.Text

myrange.Text will contain a string that is the contents of the first cell in
row i in the table.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
T

Tim

That works great. Thank you very much.

Tim

Doug Robbins - Word MVP said:
Dim myrange as Range
Dim i as Long
Set myrange ActiveDocument.Tables(1).Cell(i, 1).Range
myrange.End = myrange.End - 1
MsgBox myrange.Text

myrange.Text will contain a string that is the contents of the first cell in
row i in the table.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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