LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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




 
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
How to sort without including column headings in sort OPDvolunteer Excel Discussion (Misc queries) 4 March 11th 09 04:08 PM
Auto-Sort Won't Sort All Column Cells TikiTembo Excel Discussion (Misc queries) 1 March 25th 08 07:00 PM
data, sort option is grayed. how to sort on a column? Steve Richter Excel Discussion (Misc queries) 1 September 25th 07 03:25 PM
my column is sorted in two sections. How do I sort entire column? Elcar Excel Discussion (Misc queries) 0 February 13th 06 08:41 PM
How can I sort one column and have the entire row sort. (binding) Blue Excel Worksheet Functions 10 November 13th 05 07:09 PM


All times are GMT +1. The time now is 05:01 AM.

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

About Us

"It's about Microsoft Excel"