Need to Redefine Range to include Additional Ranges 
Author Message
 Need to Redefine Range to include Additional Ranges

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



Fri, 16 Dec 2005 21:51:58 GMT  
 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



Sat, 17 Dec 2005 00:44:02 GMT  
 Need to Redefine Range to include Additional Ranges
Again I found a solution. I did the following:

Set MyRange = Range(MyRange, YourRange)

I just needed a littel more time with it,

Jamie



Sat, 17 Dec 2005 01:29:03 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Crystal Reports 8.5 date range parameter field - record selection that includes null date range

2. How do I select a constant time range from a variable time range using VBA

3. Very simple Range question - beggining the range on 3rd page onwards

4. VBA EXCEL97: How to get the range from a chart into a range object

5. Return ONLY selected paragraphs within a range that includes a table

6. Including a Parameter Field (Date Range) in a report

7. need code to copy range from excel to access

8. Acc97: Need VBA help on a date range function

9. Need a simple macro to make page number ranges

10. Newbie: Need help with setting Fiscal Year Date Range

11. SQL help needed to select date range from Access DB

12. Newbie: Need help with setting Fiscal Year Date Range

 

 
Powered by phpBB® Forum Software