View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel[_480_] joel[_480_] is offline
external usenet poster
 
Posts: 1
Default making a drop down to sort data


You can use the dialog method shown below

Range("a2:d971").Select
Set Sortdialog = Application.Dialogs(xlDialogSort)
With Sortdialog
.Show

End With

End Sub



The dialog has these options

'xlDialogSort orientation, key1, order1, _
'key2, order2, key3, order3, header, custom, case


So you can specify these arguments like this

Range("a2:d971").Select
Set Sortdialog = Application.Dialogs(xlDialogSort)
With Sortdialog
.Show arg1:=xlAscending, arg2:="$A:$A"

End With

End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=166926

Microsoft Office Help