
Need to Redefine Range to include Additional Ranges
Hi, Jamie,
Assuming that MyRange comes before YourRange in the document, use
MyRange.End = YourRange.End
(which leaves MyRange.Start untouched) to cover everything in between. If
the two ranges were separated by some text that wasn't in either range
originally, that will also be included -- there is no way to assign ranges
with holes in them. (Starting in Word 2002, the user could use the Ctrl key
and the mouse to select noncontiguous text, but you can't do that from VBA.)
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://www.mvps.org/word
Quote:
> Hi,
> I need to have a Range expand to include additional ranges.
> e.g. Set MyRange = MyRange + YourRange
> So that MyRange.Select will select the total area encompassed by the
> prior two ranges.
> I have tried Append, Join, Merge... these all seem to deal with the
> contents of the ranges. Whereas I want to merge the ranges NOT the
> cell values.
> Any help please,
> Jamie