Sub Macro1()
Application.ScreenUpdating = False
With ActiveSheet.[A10:C5000]
.Columns(1).FormulaR1C1 = "=R[-1]C+(R[-1]C3="""")"
.Sort Key1:=.Columns(1), Order1:=xlAscending, Key2:=.Columns(3), Order2:=xlAscending, _
Header:=xlNo, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, DataOption2:=xlSortNormal
.Columns(1).ClearContents
End With
End Sub