I need a Macro to sort all sheets in a workbook by name that puts numbered (i.e. 6,7,8,9,10) first and then text names last. (i.e. "Samples", "Content") So it would look like 6,7,8,9,10,20,115,Content, Samples.
Here is what I have so far that does the numbered sheets correctly but puts the text named sheets first.
Sub WorksheetsSortAscending()
' sort worksheets in a workbook in ascending order
Dim sCount As Integer, i As Integer, j As Integer
sCount = Worksheets.Count
If sCount = 1 Then Exit Sub
For i = 1 To sCount - 1
For j = i + 1 To sCount
If Val(Worksheets(j).Name) < Val(Worksheets(i).Name) Then
Worksheets(j).Move before:=Worksheets(i)
End If
Next j
Next i
End Sub
Bookmarks