Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Sort more than 3 columns + choose ascending or descending

Hello,

I have a small problem ... I would like to sort more than 3 columns
(actually as much as I want) in excel using vba programming. In the same, I
would need to be able to choose if a column should be sorted ascending or
descending.

I already found a solution on the internet for sorting more than 3 columns :
it's to concatenate all the columns I want to sort and then sort that
columns but in that case I cannot choose to sort each column ascending or
descending....

Thanks in advance for your help.

Nader


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default Sort more than 3 columns + choose ascending or descending

Hi Nader,

From Excel online Help:

Sort rows by four criteria (columns)
1.. Click a cell in the range you want to sort.
2.. On the Data menu, click Sort.
3.. In the first Sort by box click the column of least importance.
4.. Click OK.
5.. On the Data menu, click Sort.
6.. In the Sort by and Then by boxes, click the other three columns you want to sort, starting with the most important.
7.. Select any other sort options you want, and then click OK.
Record these actions in a macro and change where necessary

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Nader" wrote in message ...
| Hello,
|
| I have a small problem ... I would like to sort more than 3 columns
| (actually as much as I want) in excel using vba programming. In the same, I
| would need to be able to choose if a column should be sorted ascending or
| descending.
|
| I already found a solution on the internet for sorting more than 3 columns :
| it's to concatenate all the columns I want to sort and then sort that
| columns but in that case I cannot choose to sort each column ascending or
| descending....
|
| Thanks in advance for your help.
|
| Nader
|
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Sort more than 3 columns + choose ascending or descending

Hi Niek,

Thank you for taking time to reply to my post but unfortunately it only
works for 4 columns.
In my case, I need to sort more than 3 columns but that I mean that one time
it could be 3 columns another time 10 columns. So, I was looking for
something flexible in vba or excel formula ...

Thanks a lot.

"Niek Otten" a écrit dans le message de news:
...
Hi Nader,

From Excel online Help:

Sort rows by four criteria (columns)
1.. Click a cell in the range you want to sort.
2.. On the Data menu, click Sort.
3.. In the first Sort by box click the column of least importance.
4.. Click OK.
5.. On the Data menu, click Sort.
6.. In the Sort by and Then by boxes, click the other three columns you
want to sort, starting with the most important.
7.. Select any other sort options you want, and then click OK.
Record these actions in a macro and change where necessary

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Nader" wrote in message
...
| Hello,
|
| I have a small problem ... I would like to sort more than 3 columns
| (actually as much as I want) in excel using vba programming. In the
same, I
| would need to be able to choose if a column should be sorted ascending
or
| descending.
|
| I already found a solution on the internet for sorting more than 3
columns :
| it's to concatenate all the columns I want to sort and then sort that
| columns but in that case I cannot choose to sort each column ascending
or
| descending....
|
| Thanks in advance for your help.
|
| Nader
|
|




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Sort more than 3 columns + choose ascending or descending

You can sort by as many columns as you want--just 3 at a time.

In xl2003, you can apply data|filter|autofilter to the range and use the
dropdown arrow to sort your data.

Debra Dalgleish has a technique at her site that adds invisible rectangles in
the headers and then sorts the data by that field when you click on one of those
rectangles.

http://contextures.com/xlSort02.html

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Nader wrote:

Hi Niek,

Thank you for taking time to reply to my post but unfortunately it only
works for 4 columns.
In my case, I need to sort more than 3 columns but that I mean that one time
it could be 3 columns another time 10 columns. So, I was looking for
something flexible in vba or excel formula ...

Thanks a lot.

"Niek Otten" a écrit dans le message de news:
...
Hi Nader,

From Excel online Help:

Sort rows by four criteria (columns)
1.. Click a cell in the range you want to sort.
2.. On the Data menu, click Sort.
3.. In the first Sort by box click the column of least importance.
4.. Click OK.
5.. On the Data menu, click Sort.
6.. In the Sort by and Then by boxes, click the other three columns you
want to sort, starting with the most important.
7.. Select any other sort options you want, and then click OK.
Record these actions in a macro and change where necessary

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Nader" wrote in message
...
| Hello,
|
| I have a small problem ... I would like to sort more than 3 columns
| (actually as much as I want) in excel using vba programming. In the
same, I
| would need to be able to choose if a column should be sorted ascending
or
| descending.
|
| I already found a solution on the internet for sorting more than 3
columns :
| it's to concatenate all the columns I want to sort and then sort that
| columns but in that case I cannot choose to sort each column ascending
or
| descending....
|
| Thanks in advance for your help.
|
| Nader
|
|



--

Dave Peterson
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
Column sort with Ascending / Descending Arrows JT Excel Worksheet Functions 3 May 18th 08 02:40 AM
Ascending Sort formula, change to neg #: descending sort.. nastech Excel Discussion (Misc queries) 6 July 2nd 07 11:00 PM
sort function - from ascending to descending jimmyp[_2_] Excel Programming 5 March 14th 06 06:11 PM
Sort other than by alphabetical ascending/ descending Melissa Excel Discussion (Misc queries) 6 September 2nd 05 07:25 AM
how can I hide sort ascending and sort descending options in the . vida Excel Discussion (Misc queries) 0 December 11th 04 12:31 AM


All times are GMT +1. The time now is 03:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"