See Code:
Code:
--------------------
Private Sub CommandButton1_Click()
Application.Run "SortTest1!SelectNSort"
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A1").Select
End Sub
--------------------
Try the attached file (Click the button)
Edit the code by way of the VBA editor, and where I have
"Selection.Sort Key1:=Range("A1")," Change *A1* to *B1*, and click the
button again to see the results.
This should give you an idea as to what's happening in the SORT".
Good Luck in your endeavours.
+-------------------------------------------------------------------+
|Filename: SortTest1.zip |
|Download:
http://www.excelforum.com/attachment.php?postid=4164 |
+-------------------------------------------------------------------+