Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Kendrick, Idaho, USA
    Posts
    277
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Sort sheets (any)

    Is it possible to sort sheet tabs? I have been asked how to alphabetize the tabs, without manually rearranging, one by one.

    Thanks

  2. #2
    5 Star Lounger
    Join Date
    Aug 2004
    Location
    Connecticut, USA
    Posts
    816
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sort sheets (any)

    This should do the trick

    <pre>Sub TabSort()
    Dim TabCount As Integer, t1 As String, t2 As String, temp As Sheets, loop1 As Integer
    Dim loop2 As Integer
    TabCount = Worksheets.count

    For loop1 = 1 To TabCount
    For loop2 = loop1 To TabCount
    t1 = Sheets(loop1).Name
    t2 = Sheets(loop2).Name
    If t2 < t1 Then
    Sheets(t2).Move before:=Sheets(t1)
    End If
    Next
    Next
    End Sub
    </pre>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •