Re: VBA Code to sort worksheets based on a pre-sorted named-range
RPerkins
This may need adjusting to suit your range:
Code
Sub SortWS()
Dim i As Long, r As Range
Application.ScreenUpdating = False
With CreateObject("System.Collections.SortedList")
For Each r In Range("a1", Range("a" & Rows.Count).End(xlUp))
.Item(r.Offset(, 1).Value) = r.Value
Next
For i = 0 To .Count - 1
Sheets(.getbyindex(i)).Move after:=Sheets(.Count)
Next
End With
Application.ScreenUpdating = True
End Sub
Display More