Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Sort Macro: Utilizing ComboBox Selection for Key1 through 3 Ranges
Good morning,
I want to design a button that, when clicked, will sort information contained on the sheet by the columns defined by the user. The basic functionality i am looking for uses 6 comboboxes, 3 of which are used to select the column name and 3 of which are used to select either ascending or descending, so the boxes would be working in pairs. I currently have the comboboxes referencing a list with the first column as the heading name and the second column as the first reference cell for that column. The first column is the text column and the second column is the bound column. I am looking for the sort macro to reference the bound column and assign this as the Key to be used in the macro in place of the range. This would be done for all 3 keys. In addition, the macro would reference the ascending, descending combobox value and use that under the Order portion of the macro. If it helps, this is what i am working with: ActiveSheet.Range("A7:M20").Select Selection.Sort Key1:=Range("A7"), Order1:=xlAscending, Key2:=Range("B7") _ , Order2:=xlDescending, Key3:=Range("D7"), Order3:=xlAscending, Header _ :=xlNo, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortTextAsNumbers, DataOption2:=xlSortNormal, DataOption3 _ :=xlSortNormal Any help will be greatly appreciated. thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sort Macro | Excel Discussion (Misc queries) | |||
Using a MACRO to sort data | Excel Worksheet Functions | |||
Leading zeros | Excel Discussion (Misc queries) | |||
How can I get a macro in Excel to set the Zoom to "Selection"? | Excel Discussion (Misc queries) | |||
Macro to sort by cell colour | Excel Worksheet Functions |