DougStroud
Well-known Member
- Joined
- Aug 16, 2005
- Messages
- 2,976
- Office Version
- 365
- Platform
- MacOS
I am doing a sort on a sheet. I would like to choose which sort method to use depending on what stage I am in. I was thinking I could use an input box and then have a list of the two choices show up, then select one or the other. Is this possible?
The first sort is sorting by Item# and the second sort is by Item Description. So If I could choose between "Item#" or "Description".
If this is possible, what is necessary and how?
Here is my code so far-
Option Explicit
Sub Sort()
Dim ws3 As Worksheet
Dim LRow As Long
Set ws3 = Workbooks("TGSImporter.xls").Sheets("Update")
'Variables
LRow = ws3.Cells(Rows.Count, 1).End(xlUp).Row
ws3.Range("A1:I" & LRow).Sort Key1:=Range("B2"), Order1:=xlAscending, _
Header:=xlGuess
ws3.Range("A1:I" & LRow).Sort Key1:=Range("C2"), Order1:=xlAscending, _
Header:=xlGuess
End Sub
Ps. I don't want them to run together, but rather independently...
thanks....
doug
The first sort is sorting by Item# and the second sort is by Item Description. So If I could choose between "Item#" or "Description".
If this is possible, what is necessary and how?
Here is my code so far-
Option Explicit
Sub Sort()
Dim ws3 As Worksheet
Dim LRow As Long
Set ws3 = Workbooks("TGSImporter.xls").Sheets("Update")
'Variables
LRow = ws3.Cells(Rows.Count, 1).End(xlUp).Row
ws3.Range("A1:I" & LRow).Sort Key1:=Range("B2"), Order1:=xlAscending, _
Header:=xlGuess
ws3.Range("A1:I" & LRow).Sort Key1:=Range("C2"), Order1:=xlAscending, _
Header:=xlGuess
End Sub
Ps. I don't want them to run together, but rather independently...
thanks....
doug