Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting rows
Hello, I hope you can provide me a solution to this problem. I have a series
of data as outlined below. The data list has over 4000 rows and I need to sort each row in ascending order, while keeping the data association in column A. A B C D E F G Date B1 B2 B3 B4 B5 B6 1 5/7/1988 3002 4419 1729 4934 4267 1507 2 5/14/1988 1885 1507 2366 1973 1154 2237 3 5/21/1988 1507 4093 812 4770 2563 2237 4 5/28/1988 3657 1227 1973 1372 2089 4841 When I am finished sorting I would like to be able to see the data : 1 5/7/1988 1507 1729 3002 4267 4419 4934 2 5/14/1988 1154 1507 1885 1973 2237 2366 3 5/21/1988 812 1507 2237 2563 4093 4770 4 5/28/1988 1227 1372 1973 2089 3657 4841 I have tried several methods but I have not found anything that really works well. The best I have done is converting the data using data list but that really does not help me. -- Lowell Shoaf Realtor RE/MAX Gulfstream Realty Sarasota, Florida |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting rows
Copy | Paste Special | Transpose the numbers to another range of
cells. Sort the result, each column independently. Copy | Paste Special | Transpose the sorted numbers back to their original location. Since you have 4000 rows (and unless you have Excel 2007), you will have to do it in chunks. The following Sub should help with the sorting. Change the number of columns, etc. to suit. Sub Macro1() Dim iEnd As Integer Dim ws As Worksheet Set ws = Sheets("Sheet1") iEnd = ws.Range("A1").End(xlDown).Row For iCol = 1 To 4 ws.Range(Cells(1, iCol), Cells(iEnd, iCol)).Sort _ Key1:=Cells(2,iCol), Order1:=xlAscending, _ Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom, DataOption1:=xlSortNormal Next iCol End Sub Hth, Merjet |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting rows
Interesting, indeed. Thanks!
Merjet |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting rows
you're welcome, Merjet ;)
Warm Regards, Crystal * (: have an awesome day :) * MVP Access Remote Programming and Training strive4peace2006 at yahoo.com * merjet wrote: Interesting, indeed. Thanks! Merjet |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting rows
you're welcome, Lowell ;) happy to help
Warm Regards, Crystal * (: have an awesome day :) * MVP Access Remote Programming and Training strive4peace2006 at yahoo.com * Lowell wrote: Thanks, your terrific, the sub routine worked perfectly. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sorting Rows | Excel Worksheet Functions | |||
How many rows after sorting? | Excel Discussion (Misc queries) | |||
Sorting rows | Excel Worksheet Functions | |||
Sorting Rows | Excel Worksheet Functions | |||
Sorting Rows | Excel Programming |