Link to home
Start Free TrialLog in
Avatar of JohnRobinAllen
JohnRobinAllenFlag for Canada

asked on

Select continuous cells in a Word table column

With VBA in Word 2010, if I have

     Dim col as Column
     set col = Activedocument.tables(1).columns(3)

is there not a short, one-line command to select cells x to y in that column?
I'd even take a two or three line command.
Thanks!
   j.r.a.
Avatar of Chris Bottomley
Chris Bottomley
Flag of United Kingdom of Great Britain and Northern Ireland image

Short ... not especially unless you split it down into ranges and then recombine but the net effect either via a with or ranges is as follows~:

activedocument.range(activedocument.tables(1).columns(1).cells(2).Range.Start, activedocument.tables(1).columns(1).cells(4).Range.end).Select

Chris
SOLUTION
Avatar of Chris Bottomley
Chris Bottomley
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JohnRobinAllen

ASKER

Chris solved the problem and gets full credit. Graham's comment is important and deserves extra points for it. Thanks to both.<br />     It is a sunny day today in Priddis, Alberta, both outside (with the weather) and inside (thanks to the solution provided above). <br />     
--j.r.a.
It's sunny where I am the UK today as well. Chris is about 100 miles north, but I guess that it's about the same.