Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort Code Modification
I have the following working code to sort the range of data by the value in
combobox1. Using the following code, what adjustments do I need to make to get it to sort all the data by Ext? Private Sub CommandButton2_Click() 'Sorts by the stat you select in the combobox. 'Sorts all data in the range A4:Z100 Dim Rng As Range, rng1 As Range Dim res As Variant Dim rng2 As Range With Worksheets(1) Set Rng = .Range("A4:Z100") Set rng1 = .Range("A4:Z4") End With res = Application.Match(ComboBox1.Value, rng1, 0) If Not IsError(res) Then Set rng2 = rng1(1, res) Rng.Sort Key1:=rng2, Order1:=xlAscending, _ Header:=xlYes, OrderCustom:=1, _ MatchCase:=False, Orientation:=xlTopToBottom End If Unload Me End Sub Thanx Todd Huttenstine |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort Code Modification
Todd Huttenstine(Remote) wrote:
Using the following code, what adjustments do I need to make to get it to sort all the data by Ext? I assume "Ext" is the heading of a field somewhere in A4:Z4? res = Application.Match("Ext", rng1, 0) Bill Manville MVP - Microsoft Excel, Oxford, England No email replies please - reply in newsgroup |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
modification to this code | Excel Discussion (Misc queries) | |||
Code modification help | Excel Worksheet Functions | |||
line code modification | Excel Discussion (Misc queries) | |||
Code Modification(From previous post) | Excel Programming | |||
Modification to code | Excel Programming |