maybe so (with helper column C)
Sub ertert()
Dim r As Range
Application.ScreenUpdating = False
With Range("B1:C" & Cells(Rows.Count, 2).End(xlUp).Row)
    For Each r In .Columns(1).Cells
        r(1, 2) = r.Borders.Value
    Next
    .Borders.LineStyle = xlLineStyleNone
    .Sort Key1:=.Cells(1), Order1:=xlAscending
    For Each r In .Columns(1).Cells
        r.Borders.LineStyle = r(1, 2).Value
    Next
    .Columns(2).ClearContents
End With
Application.ScreenUpdating = True
End Sub