Originally Posted by
mdmackillop
This gives you the option to set the sort column
[vba]Sub sortdata()
Dim Col
Col = InputBox("Column to sort by?")
Sheets("running data").Cells.Copy Sheets("auto desecending").Range("A1")
With ActiveWorkbook.Worksheets("auto desecending")
.Cells.Sort Key1:=.Cells(2, Col), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End With
End Sub
[/vba]
Pavel,
Good working code. Try though, to trim out "Select" which simplifies and speeds up the execution of your code.