Hello tinzpro,
Welcome to the Forum!
In future posts, please attach a workbook rather than a picture. Posting a workbook will get you an answer quicker. People are not to inclined to take the time to recreate your work. This macro should do what need. Let me the results.
Sub SortByEarliestDate()
Dim Rng As Range
Dim RngEnd As Range
Dim Wks As Worksheet
Set Wks = ActiveSheet
Set Rng = Wks.Range("A1").EntireColumn
Set Rng = Rng.Resize(ColumnSize:=Wks.Cells(1, Columns.Count).End(xlToLeft).Column - Rng.Column + 1)
Set RngEnd = Rng.Find("*", , xlFormulas, xlWhole, xlByRows, xlPrevious, False)
Set Rng = Rng.Resize(RowSize:=RngEnd.Row - Rng.Row + 1)
With Wks.Sort
.SortFields.Clear
.SortFields.Add Key:=Rng.Offset(1, 0).Resize(Rng.Rows.Count - 1, 1), _
SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
.SetRange Rng
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Bookmarks