Having trouble extending rnage/selection upward

E

Ed

My report is formatted with a caption, blank paragraph, then a table. I use
a Find.Execute to find a text string in the table. Then I can select the
whole table. Now I want to extend the selection (or range, if that would be
better) upwards to include the entire caption. I've tried .MoveUp and
..MoveStart with both Selection and Range, but can't seem to get it to work.
Any help is greatly appreciated.

Ed
 
J

JGM

Hi Ed,

Try something like this:

'_______________________________________
Dim MyRange As Range
Dim RangeEnd As Long

RangeEnd = Selection.End

Selection.Tables(1).Cell(1, 1).Select
Selection.MoveUp wdParagraph, 3

Set MyRange = Selection.Range
MyRange.SetRange MyRange.Start, RangeEnd
'_______________________________________

HTH
Cheers!
 
E

Ed

Thank you once again! As you can probably tell, I'm just learning the ins
and outs of working with ranges. But I'll get it! (With assists from you
guys, of course!) 8>)

Ed
 
Top