Need Help Sorting rows in Excel SpreadSheet

cyrusv

Registered User.
Local time
Today, 00:54
Joined
May 27, 2011
Messages
21
Hi all i have a problem at hand, i am required to sort the below spreadsheet data using any method, most probably through a procedural call.

i am tried using a access table to import the table from an excel file and sort it using dao recordset then write it to a excel file. i attached a code for y'all to see

Data i have:

ID Col1 Col2
1 A1 B2
2 A2 B3
3 B2 C4
4 B3 C5
5 C4 D6
6 C5 D7


I need it to be sorted like this:


ID Col1 Col2
1 A1 B2
2 B2 C4
3 C4 D6
4 A2 B3
5 B3 C5
6 C5 D7
 

Attachments

you will need another column, called sort order.

how many items are there, generally.
 
you will need another column, called sort order.

how many items are there, generally.

There would be close to 1500 records
sorry, but how should i use the sort order column?

Just to clarify again, i would need to arrange the in the way that it is sorted in continuity.. i tried looping through the current excel rows against the remainder rows but only manage to achieve A to B then B to C, so 2 stages

1) A to B
2) B to C
3) C to D
 
Not sure if this give you some idea, open qryExportToExcel and see.

It basically the same idea that you used in your other post.

JR
 

Attachments

Not sure if this give you some idea, open qryExportToExcel and see.

It basically the same idea that you used in your other post.

JR

how did you do this>?
 
Look at the functions in module1 it basically walks 2 recordset based on the original recordset and for each record it inserts in the temp table it adds a sorting field like Gemma said in his post. So when you query this table and order by this sort field you get your new sequence.

It was alot of trial and misses and different ideas, and extensive use of access help files.

JR
 
Look at the functions in module1 it basically walks 2 recordset based on the original recordset and for each record it inserts in the temp table it adds a sorting field like Gemma said in his post. So when you query this table and order by this sort field you get your new sequence.

It was alot of trial and misses and different ideas, and extensive use of access help files.

JR

THANKS! i adapted it well enough for my prototype
 

Users who are viewing this thread

Back
Top Bottom