Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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
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
how copy formula that contains ranges so ranges do not overlap Patty Excel Worksheet Functions 1 November 20th 08 04:15 PM
Retrieving the Collection of Ranges in a Workbook K Dales[_2_] Excel Programming 0 January 19th 05 09:16 PM
Retrieving the Collection of Ranges in a Workbook K Dales[_2_] Excel Programming 0 January 19th 05 09:16 PM
Deleting named ranges by looping through range collection agarwaldvk[_11_] Excel Programming 3 August 3rd 04 01:00 AM
named ranges - changing ranges with month selected gr8guy Excel Programming 2 May 28th 04 04:50 AM


All times are GMT +1. The time now is 08:16 PM.

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"