Sub SortFilesByDate() Application.FileDialog(msoFileDialogOpen).Show ActiveWorkbook.Sort.SortFields.Clear ActiveWorkbook.Sort.SortFields.Add2 Key:=Range("A1"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal ActiveWorkbook.Sort.SortFields.Add2 Key:=Range("B1"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal With ActiveWorkbook.Sort .SetRange Range("YourRange") .Header = xlYes .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With End Sub