Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Multiple range selection

Hi,
Could someone help in the following problem?
I need to select several ranges of different sizes simultaneously. While I
have managed to select and store all of them separately, in an array, I
haven't been able to recall and "merge' them after storage, in a single
multiple range. I have tried to do so using the Union method but it is
impossible to write 80 to 90 objects in it, to be merged. Is there any else
more efficient method or code?
Thanks a lot


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default Multiple range selection

You have a few options that can be combined:
1 - Used Named ranges: select some of the ranges that are related and give
them a name in the drop down at the top left e.g. rngData1
2 - Dim rng1 As Range
Dim rng2 As Range
Dim rng3 As Range
set rng1=range("A1:G6,H7,M89:U100,rngData1)
set rng2=range("C13,D15:F67)
3 - set rng3=Union(rng1,rng2)
rng3.select
The limit on a Union is 30 ranges, but you can build those from the other
techniques.

NickHK

"I. N. Manoussopoulos" ...
Hi,
Could someone help in the following problem?
I need to select several ranges of different sizes simultaneously. While I
have managed to select and store all of them separately, in an array, I
haven't been able to recall and "merge' them after storage, in a single
multiple range. I have tried to do so using the Union method but it is
impossible to write 80 to 90 objects in it, to be merged. Is there any
else
more efficient method or code?
Thanks a lot




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Multiple range selection

Thanks for the advise,

I was also thinking on the possibility of using a loop, or a function for
doing this, as manipulating all these variables by hand increases the chance
for errors. I was thus wondering whether the Union method could be part of
a For Next (and the like) construction of the form
set rg(i)= Union(rg(i), Rg(i+1))

Best regards






"NickHK" wrote in message ...
You have a few options that can be combined:
1 - Used Named ranges: select some of the ranges that are related and give
them a name in the drop down at the top left e.g. rngData1
2 - Dim rng1 As Range
Dim rng2 As Range
Dim rng3 As Range
set rng1=range("A1:G6,H7,M89:U100,rngData1)
set rng2=range("C13,D15:F67)
3 - set rng3=Union(rng1,rng2)
rng3.select
The limit on a Union is 30 ranges, but you can build those from the other
techniques.

NickHK

"I. N. Manoussopoulos"

...
Hi,
Could someone help in the following problem?
I need to select several ranges of different sizes simultaneously. While

I
have managed to select and store all of them separately, in an array, I
haven't been able to recall and "merge' them after storage, in a single
multiple range. I have tried to do so using the Union method but it is
impossible to write 80 to 90 objects in it, to be merged. Is there any
else
more efficient method or code?
Thanks a lot






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Narrow Range based on Selection in Another Range David Excel Discussion (Misc queries) 3 July 1st 07 05:12 PM
Multiple range selection issue SPV Excel Discussion (Misc queries) 1 June 27th 07 04:15 PM
Identifying a selection of a selection of a range swimfast Excel Worksheet Functions 1 March 1st 07 02:51 AM
Multiple Range Selection mcgj Excel Programming 1 January 4th 06 02:49 AM
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. jonH Excel Programming 3 June 7th 04 09:13 PM


All times are GMT +1. The time now is 06:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"