+ Reply to Thread
Results 1 to 2 of 2

Alternitive to Collection of Ranges

  1. #1
    Abode
    Guest

    Alternitive to Collection of Ranges

    Is there a way I can sort entire rows in a collection. I have a rather large
    program that will change the order of many rows based on options the user
    uses. I've everything working properly up until it actually needs to move
    the cells around. I tried creating a collection of ranges but it appears
    that a range only points to a location on the spreadsheet. So if I use the
    collection of ranges when it rewrites one row the range that gets information
    from that row will have the new information. I am not sure if any of this
    makes sense. If anyone has any ideas about what I can do please let me know.
    The only thing I can really think of is writing the data to a new spreadsheet
    or to a net set of rows but I fear that will take far too many resources.
    Thank you for your time.

  2. #2
    Tom Ogilvy
    Guest

    RE: Alternitive to Collection of Ranges

    ' Establish the collection
    set rng = Range("A1").CurrentRegion
    ' sort the collection
    rng.Sort Key1:=Range("A1"), Order1:=xlAscending

    --
    Regards,
    Tom Ogilvy


    "Abode" wrote:

    > Is there a way I can sort entire rows in a collection. I have a rather large
    > program that will change the order of many rows based on options the user
    > uses. I've everything working properly up until it actually needs to move
    > the cells around. I tried creating a collection of ranges but it appears
    > that a range only points to a location on the spreadsheet. So if I use the
    > collection of ranges when it rewrites one row the range that gets information
    > from that row will have the new information. I am not sure if any of this
    > makes sense. If anyone has any ideas about what I can do please let me know.
    > The only thing I can really think of is writing the data to a new spreadsheet
    > or to a net set of rows but I fear that will take far too many resources.
    > Thank you for your time.


+ 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