Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
buddhapenguin
 
Posts: n/a
Default 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
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
Sort Macro Sprinks Excel Discussion (Misc queries) 1 April 19th 05 04:58 PM
Using a MACRO to sort data BAM718 Excel Worksheet Functions 5 April 16th 05 01:40 PM
Leading zeros JC Excel Discussion (Misc queries) 9 February 1st 05 02:33 PM
How can I get a macro in Excel to set the Zoom to "Selection"? GarryH Excel Discussion (Misc queries) 2 December 21st 04 01:44 PM
Macro to sort by cell colour CoZ Excel Worksheet Functions 1 November 16th 04 05:52 PM


All times are GMT +1. The time now is 07:53 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"