Page 1 of 1

Sort Columns?

Posted: Fri Feb 06, 2015 1:33 pm
by Anonymous47
Only a little question:

I have a excel sheet with 3 columns.
How can i sort using column 2 oder 3?

XLS[0].Sort(0,XLS[0].FirstRow,2,XLS[0].LastRow,TRUE,TRUE);

only sorts using column 0.

Thanks for help.

Re: Sort Columns?

Posted: Thu Feb 12, 2015 8:03 am
by Anonymous47
...

Re: Sort Columns?

Posted: Mon Feb 16, 2015 9:37 am
by larsa
Hello

The values of FirstRow and LastRow is probably wrong. You must use XLS[0].CalcDimensions before you can use these values.

Re: Sort Columns?

Posted: Mon Feb 16, 2015 3:35 pm
by Anonymous47
I think you dont understand me. I will sort full rows, but not only ohne column of a row, and not column 1, but column 2 oder 3.

Re: Sort Columns?

Posted: Tue Feb 17, 2015 11:08 am
by larsa
Hello

Sort on column 2

Code: Select all

XLS[0].Sort(1,XLS[0].FirstRow,1,XLS[0].LastRow,TRUE,TRUE);
Sort on column 3

Code: Select all

XLS[0].Sort(2,XLS[0].FirstRow,2,XLS[0].LastRow,TRUE,TRUE);

Re: Sort Columns?

Posted: Thu Feb 19, 2015 9:05 pm
by Anonymous47
You dont understand me. Small example:

23456 - - a - - 07.01.1900
43 - - f - - 01.01.1900
356675 - - df - - 02.01.1900

XLS[0].Sort(2,XLS[0].FirstRow,2,XLS[0].LastRow,TRUE,TRUE);

Result:

23456 - - a - - 01.01.1900
43 - - f - - 02.01.1900
356675 - - df - - 07.01.1900

but it should be

43 - - f - - 01.01.1900
356675 - - df - - 02.01.1900
23456 - - a - - 07.01.1900

Re: Sort Columns?

Posted: Thu Feb 26, 2015 8:28 pm
by Anonymous47
Push