+ Reply to Thread
Results 1 to 3 of 3

Arrange the sheet name in ascending order

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-19-2010
    Location
    INDIA
    MS-Off Ver
    MSoffice-2019
    Posts
    339

    Arrange the sheet name in ascending order

    I have a file having 86 sheets with different name of each sheet.Now,I want to sort all 86 sheets in ascending order.

    Here,I have taken an example of 4 sheets,namely,PAP,SPG,SPP and CND.Can we sort the sheets in an ascending order?

    Required result is-CND,PAP,SPG and SPP.

    Please refer the attach file
    Attached Files Attached Files

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Arrange the sheet name in ascending order

    Chip Pearson has a section dedicated to this topic with .bas download available:

    http://www.cpearson.com/excel/sortws.aspx

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Arrange the sheet name in ascending order

    Try this code

    Sub SortWorksheets()
    Dim i&, j&
        Application.ScreenUpdating = False
        For i = 1 To Sheets.Count - 1
            For j = i + 1 To Sheets.Count
                If UCase$(Worksheets(j).Name) < UCase$(Worksheets(i).Name) Then
                    Worksheets(j).Move Before:=Worksheets(i)
                End If
            Next j
        Next i
         Application.ScreenUpdating = True
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1