table formatting and cell selection

B

bert

i have programmed a working script that makes new tables and formats it the
way we need it and partially populates it with data

now i have used pieces of code like this
Selection.MoveRight unit:=wdCharacter, Count:=1
Selection.MoveRight unit:=wdCharacter, Count:=(UBound(HulpGieken2) + 1) *
(UBound(Hoeken2) + 1), Extend:=wdExtend
Selection.Cells.Merge

now someone told me this way (selection.moveright and such) of coding is
sensitive to error
he suggested using something like table.Range.Select but how do i select for
example from cell(2,2) to cell(6,8)

thanks
 
D

Doug Robbins - Word MVP

Dim myrange as Range
With ActiveDocument.Tables(1)
Set myrange = .Cell(2, 2).Range
myrange.End = .Cell(6, 8).Range.End
End With

Then, if you really need to select those cells

myrange.Select

--
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