Results 1 to 4 of 4

How to Short sheet name by two kinds of sheets names( alpabet then numeric )

Threaded View

  1. #1
    Forum Contributor
    Join Date
    03-11-2009
    Location
    Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    252

    How to Short sheet name by two kinds of sheets names( alpabet then numeric )

    Hi,
    How to sort the sheet name from the alphabet and then numbers
    Sub Sort_Active_Book()
    Dim i As Integer
    Dim j As Integer
    Dim iAnswer As VbMsgBoxResult
    iAnswer = MsgBox("Sort Sheets in Ascending Order?" & Chr(10) _
    & "Clicking No will sort in Descending Order", _
    vbYesNoCancel + vbQuestion + vbDefaultButton1, "Sort Worksheets")
    For i = 1 To Sheets.Count
    For j = 1 To Sheets.Count - 1
    If iAnswer = vbYes Then
    If UCase$(Sheets(j).Name) > UCase$(Sheets(j + 1).Name) Then
    Sheets(j).Move After:=Sheets(j + 1)
    End If
    ElseIf iAnswer = vbNo Then
    If UCase$(Sheets(j).Name) < UCase$(Sheets(j + 1).Name) Then
    Sheets(j).Move After:=Sheets(j + 1)
    End If
    End If
    Next j
    Next i
    End Sub
    Sheet names : 1,2,3,a,b,c
    above code produces the sequence: ---> 1,2,3,a,b,c
    Want to be sorted into--> a,b,c,1,2,3

    Thanks in advance
    Last edited by herukuncahyono; 09-19-2013 at 12:17 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 17
    Last Post: 02-01-2013, 12:20 PM
  2. I can't save long file names, only short one, how can I do this?
    By short file names in forum Excel General
    Replies: 0
    Last Post: 01-03-2006, 01:15 PM
  3. reference to sheets without using sheet names
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 54
    Last Post: 09-06-2005, 08:05 PM
  4. [SOLVED] reference to sheets without using sheet names
    By Wes in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  5. [SOLVED] reference to sheets without using sheet names
    By Wes in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 09-03-2005, 04:05 PM

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