Go To Row Column

F

Fred Holmes

In a MS Word (2003) table is there any way to execute a "Go To Row
Column," i.e, the equivalent of pressing F5 in Excel and typing in the
desired Cell Address, e.g. "D37"? (Starting with the insertion point
within the applicable table, of course.)
 
K

Klaus Linke

Fred Holmes said:
In a MS Word (2003) table is there any way to execute a
"Go To Row Column," i.e, the equivalent of pressing F5
in Excel and typing in the desired Cell Address, e.g. "D37"?
(Starting with the insertion point within the applicable
table, of course.)


Hi Fred,

Not out of the box...
One thing you can do is add the "TableFormatCell" dialog to some menu or
toolbar (Tools > Customize... > Commands > Categories: All commands).
It shows you the row and column you are in, and has "Previous row" / "Next
row" / "Previous column" / "Next column" buttons that allow you to navigate
to some specific cell.

Another option would be a macro:

Dim myRow, myColumn, myString
myString = _
InputBox("e.g. B4=2nd column, 4th row", _
"Navigate to cell...", "A1")
myColumn = Left(myString, 1)
myColumn = AscW(myColumn) - AscW("A") + 1
myRow = Val(Mid(myString, 2))
Selection.Tables(1).Cell(myRow, _
myColumn).Select

Hope I got the spreadsheet nomenclature right...
You might add some code for error handlers, or for columns > "Z".

Regards,
Klaus
 
F

Fred Holmes

This works very nicely except that the selection (selected cell that
has been "gone to") remains off the screen. Is there a command to
scroll the selection to the center of the screen? Or even to the edge
of the screen if it is off screen?

Thanks,

Fred Holmes
 
K

Klaus Linke

Is there a command to scroll the selection to the
center of the screen?


Hi Fred,

This should bring it onto the screen (though probably not centered):
ActiveWindow.ScrollIntoView Obj:=Selection.Range, Start:=True

Regards,
Klaus
 

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