マウロの記録で取得したコードを変更したものです。
Sub Test()
With Sheets("Sheet1")
.Sort.SortFields.Clear
.Sort.SortFields.Add Key:=.Range(.Cells(Selection(1).Row, "C"), .Cells(Selection(Selection.Count).Row, "C")), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.Sort.SortFields.Add Key:=.Range(.Cells(Selection(1).Row, "A"), .Cells(Selection(Selection.Count).Row, "A")), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With .Sort
.SetRange Range(Rows(Selection(1).Row), Rows(Selection(Selection.Count).Row))
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End With
End Sub
お礼
ご教示有難うございます。 シンプルで、思った通りに動きました。 ひな形として活用させて頂きます。