+ Reply to Thread
Results 1 to 5 of 5

Sort the Tabs

  1. #1
    A-Design
    Guest

    Sort the Tabs

    Hi,

    Is it possible to write a VBA to sort all the TABS base on their names ?

    Thanks.



  2. #2
    Norman Jones
    Guest

    Re: Sort the Tabs

    Hi A-Design,

    Try Chip Pearson's code:


    Sub AlphaSortWorksheets()

    Dim N As Integer
    Dim M As Integer
    Dim FirstWSToSort As Integer
    Dim LastWSToSort As Integer
    Dim SortDescending As Boolean

    SortDescending = False
    FirstWSToSort = 1
    LastWSToSort = Worksheets.Count

    For M = FirstWSToSort To LastWSToSort
    For N = M To LastWSToSort
    If SortDescending = True Then
    If UCase(Worksheets(N).Name) > _
    UCase(Worksheets(M).Name) Then
    Worksheets(N).Move before:=Worksheets(M)
    End If
    Else
    If UCase(Worksheets(N).Name) < _
    UCase(Worksheets(M).Name) Then
    Worksheets(N).Move before:=Worksheets(M)
    End If
    End If
    Next N
    Next M

    End Sub

    ---
    Regards,
    Norman



    "A-Design" <afshinstock@hotmail.com> wrote in message
    news:eU7mrtyhFHA.3692@TK2MSFTNGP09.phx.gbl...
    > Hi,
    >
    > Is it possible to write a VBA to sort all the TABS base on their names ?
    >
    > Thanks.
    >




  3. #3
    Chip Pearson
    Guest

    Re: Sort the Tabs

    See www.cpearson.com/excel/sortws.htm for VBA code to do this.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "A-Design" <afshinstock@hotmail.com> wrote in message
    news:eU7mrtyhFHA.3692@TK2MSFTNGP09.phx.gbl...
    > Hi,
    >
    > Is it possible to write a VBA to sort all the TABS base on
    > their names ?
    >
    > Thanks.
    >




  4. #4
    A-Design
    Guest

    Re: Sort the Tabs

    Thank you so much for your helps.


    "Chip Pearson" <chip@cpearson.com> wrote in message
    news:uBjAL5yhFHA.3692@TK2MSFTNGP09.phx.gbl...
    > See www.cpearson.com/excel/sortws.htm for VBA code to do this.
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    >
    > "A-Design" <afshinstock@hotmail.com> wrote in message
    > news:eU7mrtyhFHA.3692@TK2MSFTNGP09.phx.gbl...
    >> Hi,
    >>
    >> Is it possible to write a VBA to sort all the TABS base on their names ?
    >>
    >> Thanks.
    >>

    >
    >




  5. #5
    A-Design
    Guest

    Re: Sort the Tabs

    Thank you very much for replies.



    "Chip Pearson" <chip@cpearson.com> wrote in message
    news:uBjAL5yhFHA.3692@TK2MSFTNGP09.phx.gbl...
    > See www.cpearson.com/excel/sortws.htm for VBA code to do this.
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    >
    > "A-Design" <afshinstock@hotmail.com> wrote in message
    > news:eU7mrtyhFHA.3692@TK2MSFTNGP09.phx.gbl...
    >> Hi,
    >>
    >> Is it possible to write a VBA to sort all the TABS base on their names ?
    >>
    >> Thanks.
    >>

    >
    >




+ 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