+ Reply to Thread
Results 1 to 3 of 3

Multiple range selection

  1. #1
    I. N. Manoussopoulos
    Guest

    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. #2
    NickHK
    Guest

    Re: 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" <[email protected]> 撰寫於郵件新聞:[email protected]...
    > 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. #3
    I. N. Manoussopoulos
    Guest

    Re: 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" <[email protected]> wrote in message news:[email protected]...
    > 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" <[email protected]>

    撰寫於郵件新聞:[email protected]...
    > > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1