Move to a Start Point for a Macro

P

Pam

I've written a simple Macro in a Word document table to
calculate figures in a row and then subtotal them at the
bottom. The problem is I need the macro to begin in a
certain cell in the table. I've not been able to find a
way to make the macro move to a specific cell in the table
at the beginning. This document will be used by many
people, so I don't have control over which row and cell
they will be in when beginning the macro. Therefore the
MoveUp and MoveDown commands will not work. Anybody come
across this before?
 
D

Dave Lett

Hi Pam,

If you know the row and column, then you might be able to use something like
the following:

Selection.Tables(1).Cell(Row:=3, Column:=2).Range.Select

HTH
 
M

martinique

Dave's method is usually the best. Another is to go to the first cell, then
use the cell's Next property to step through the cells one by one until you
find the one you need.

A common trap is to use the Rows and Columns property of the table itself.
This works fine on a regular table, but may fail if the table has merged or
split cells.
 

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