Option Explicit
Sub SortAndSubTotal()
Dim SortRng As Range
On Error Resume Next
Set SortRng = Application.InputBox("Select the range to sort" & vbCr & _
"Include Headers in the selection", "Sort-Box", 0, , , , , 8)
SortRng.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
SortRng.Select
Application.Dialogs(xlDialogSubtotalCreate).Show
Set SortRng = Nothing
End Sub
|