Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
6 column sort
Hi,
In my routine job, I need sort function that could sort data in 6 different column. Excel have only sort function with 3 different column. So I look on excel VBA macro to create this function. Before I go further to create this function, I just wonder if someone had already done this ? Or is there any other way to manipulate existing sort function ? I will appreciate any direction. I first attemp is used "Selection.sort" function. The coding as follow: Selection.Sort Key1:=Range(ComboBox1.Text), Order1:=xlAscending, Key2:=Range(ComboBox2.Text) _ , Order2:=xlAscending, Key3:=Range(ComboBox3.Text), Order3:=xlAscending, _ Header:=xlYes, MatchCase:=True, Orientation:=xlSortColumns Then I tried to append Range with other column input, but do not work: Selection.Sort Key1:=Range(ComboBox1.Text)&Range(ComboBox4.Text), Order1:=xlAscending, Key2:=Range(ComboBox2.Text))&Range(ComboBox5.Text) , Order2:=xlAscending, Key3:=Range(ComboBox3.Text))&Range(ComboBox6.Text) , Order3:=xlAscending, _ Header:=xlYes, MatchCase:=True, Orientation:=xlSortColumns I will appreciate any direction. cruesoe137 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
6 column sort
It takes two sorts. Sort on your least significant columns
first, then sort of the most significant columns. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Jose Smith" wrote in message m... Hi, In my routine job, I need sort function that could sort data in 6 different column. Excel have only sort function with 3 different column. So I look on excel VBA macro to create this function. Before I go further to create this function, I just wonder if someone had already done this ? Or is there any other way to manipulate existing sort function ? I will appreciate any direction. I first attemp is used "Selection.sort" function. The coding as follow: Selection.Sort Key1:=Range(ComboBox1.Text), Order1:=xlAscending, Key2:=Range(ComboBox2.Text) _ , Order2:=xlAscending, Key3:=Range(ComboBox3.Text), Order3:=xlAscending, _ Header:=xlYes, MatchCase:=True, Orientation:=xlSortColumns Then I tried to append Range with other column input, but do not work: Selection.Sort Key1:=Range(ComboBox1.Text)&Range(ComboBox4.Text), Order1:=xlAscending, Key2:=Range(ComboBox2.Text))&Range(ComboBox5.Text) , Order2:=xlAscending, Key3:=Range(ComboBox3.Text))&Range(ComboBox6.Text) , Order3:=xlAscending, _ Header:=xlYes, MatchCase:=True, Orientation:=xlSortColumns I will appreciate any direction. cruesoe137 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
6 column sort
Hi Chip thanks for your responds.
I am now in the middle of road to create VBA that look like on Excell menu Data Sort. My customize Data Sort have 6 column option instead of standard Excell option with 3 column to choose. Not all the time I used 6 column to sort, sometime I just need 4 or 5, and 6 column is the max option. I just wondering if I could modified the standard Excell Selection.sort function, so it can accomodate max 6 column sort with out doing 2 sort action. Irwan "Chip Pearson" wrote in message ... It takes two sorts. Sort on your least significant columns first, then sort of the most significant columns. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Jose Smith" wrote in message m... Hi, In my routine job, I need sort function that could sort data in 6 different column. Excel have only sort function with 3 different column. So I look on excel VBA macro to create this function. Before I go further to create this function, I just wonder if someone had already done this ? Or is there any other way to manipulate existing sort function ? I will appreciate any direction. I first attemp is used "Selection.sort" function. The coding as follow: Selection.Sort Key1:=Range(ComboBox1.Text), Order1:=xlAscending, Key2:=Range(ComboBox2.Text) _ , Order2:=xlAscending, Key3:=Range(ComboBox3.Text), Order3:=xlAscending, _ Header:=xlYes, MatchCase:=True, Orientation:=xlSortColumns Then I tried to append Range with other column input, but do not work: Selection.Sort Key1:=Range(ComboBox1.Text)&Range(ComboBox4.Text), Order1:=xlAscending, Key2:=Range(ComboBox2.Text))&Range(ComboBox5.Text) , Order2:=xlAscending, Key3:=Range(ComboBox3.Text))&Range(ComboBox6.Text) , Order3:=xlAscending, _ Header:=xlYes, MatchCase:=True, Orientation:=xlSortColumns I will appreciate any direction. cruesoe137 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
6 column sort
No. Excel does 2 columns at a time.
-- Regards, Tom Ogilvy "Jose Smith" wrote in message ... Hi Chip thanks for your responds. I am now in the middle of road to create VBA that look like on Excell menu Data Sort. My customize Data Sort have 6 column option instead of standard Excell option with 3 column to choose. Not all the time I used 6 column to sort, sometime I just need 4 or 5, and 6 column is the max option. I just wondering if I could modified the standard Excell Selection.sort function, so it can accomodate max 6 column sort with out doing 2 sort action. Irwan "Chip Pearson" wrote in message ... It takes two sorts. Sort on your least significant columns first, then sort of the most significant columns. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Jose Smith" wrote in message m... Hi, In my routine job, I need sort function that could sort data in 6 different column. Excel have only sort function with 3 different column. So I look on excel VBA macro to create this function. Before I go further to create this function, I just wonder if someone had already done this ? Or is there any other way to manipulate existing sort function ? I will appreciate any direction. I first attemp is used "Selection.sort" function. The coding as follow: Selection.Sort Key1:=Range(ComboBox1.Text), Order1:=xlAscending, Key2:=Range(ComboBox2.Text) _ , Order2:=xlAscending, Key3:=Range(ComboBox3.Text), Order3:=xlAscending, _ Header:=xlYes, MatchCase:=True, Orientation:=xlSortColumns Then I tried to append Range with other column input, but do not work: Selection.Sort Key1:=Range(ComboBox1.Text)&Range(ComboBox4.Text), Order1:=xlAscending, Key2:=Range(ComboBox2.Text))&Range(ComboBox5.Text) , Order2:=xlAscending, Key3:=Range(ComboBox3.Text))&Range(ComboBox6.Text) , Order3:=xlAscending, _ Header:=xlYes, MatchCase:=True, Orientation:=xlSortColumns I will appreciate any direction. cruesoe137 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to sort without including column headings in sort | Excel Discussion (Misc queries) | |||
Auto-Sort Won't Sort All Column Cells | Excel Discussion (Misc queries) | |||
data, sort option is grayed. how to sort on a column? | Excel Discussion (Misc queries) | |||
my column is sorted in two sections. How do I sort entire column? | Excel Discussion (Misc queries) | |||
How can I sort one column and have the entire row sort. (binding) | Excel Worksheet Functions |