Sort more then 65,000 rows in Excel

J

Jeff

Hi,

I am using Excel 2003 and it is limited to 65,000 rows. I want to sort a
..csv file that has ~ 360,000 rows. I tried using the Bubble sort macro to do
this but it is too slow. Is there any way to do this using excel?

Thanks
 
K

Kevin B

Other than upgrading to Office 2007, there's not much you can do in Exel.

If your file source is a delimited file you could bring it into MS Word,
convert the data to a table using your delimiter as a column break and the
sort the table.
 
P

Pete_UK

The algorithm you need is a merge sort. Assuming you have split your
file into sheet-size chunks (there is a macro to do this from MS), you
have to sort each sheet separately which you can do with the normal
sort function. Then your macro would have to examine the top row in
each of the six sheets and extract or copy the appropriate record into
a new sheet and adjust the counter/pointer for that sheet. You will
have to maintain a pointer for each sheet and increment the
appropriate pointer, so that each time around the loop you are always
looking at the six "top" records and deciding which is the next one to
take. You also have to keep a count of the number of rows you have
used in the destination sheet, so that when it is full you then start
to use a new sheet. When you have filled up your six sorted sheets,
you can remove the original 6 sheets.

Hope this helps.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top