Public Sub Sort_Worksheets()
Dim i As Long, j As Long
With ThisWorkbook
For i = 1 To .Worksheets.Count
For j = 1 To .Worksheets.Count - 1
If .Worksheets(j).Cells(Rows.Count, 1).End(xlUp).Row < .Worksheets(j + 1).Cells(Rows.Count, 1).End(xlUp).Row Then
.Worksheets(j).Move After:=.Worksheets(j + 1)
End If
Next
Next
End With
End Sub