I would like to know how I can program into a macro the ability for the
cursor to goto a specifc cell in a table. For example cell F5.

Thank you

Re: Going to specific cells in a table by Greg

Greg
Fri Jan 18 08:37:28 PST 2008

Sub ScratchMacro()
Selection.Tables(1).Cell(5, 6).Range.Select 'For the current table
Selection.Collapse wdCollapseStart
'Or
ActiveDocument.Tables(1).Cell(5, 6).Range.Select 'For the first table in the
document
Selection.Collapse wdCollapseStart
End Sub


--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Doc60 wrote:
> I would like to know how I can program into a macro the ability for
> the cursor to goto a specifc cell in a table. For example cell F5.
>
> Thank you



Re: Going to specific cells in a table by fumei

fumei
Fri Jan 18 11:52:25 PST 2008

Or, depending on your requirements, use a bookmark. If a cell is bookmarked,
and it is named "test", you can move the Selection to it, and select it by:

Selection.GoTo what:=wdGoToBookmark, Name:="test"

If you want to move the Selection to it, but NOT select it - ie. you want the
cursor at the start of it:

Selection.GoTo what:=wdGoToBookmark, Name:="test"
Selection.Collapse Direction:=wdCollapseStart

If you want to simply display the content of what it there, and again the
cell is bookmarked as "test"

MsgBox ActiveDocument.Bookmarks("test").Range.Text

BTW: I will assume by cell F5 you mean Row 6, Column 5. Word is not Excel.


Doc60 wrote:
>I would like to know how I can program into a macro the ability for the
>cursor to goto a specifc cell in a table. For example cell F5.
>
>Thank you

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-programming/200801/1