Hi,
I have read several posts where it is possible to sort worksheets in an alphabetical order.
I would like to sort worksheets where there are 15 sheets named let's say 'Sheet1', 'Sheet2',..., 'Sheet15'.
Using the following code that I seen in another thread:
Sub Test1()
Dim i As Integer, j , As Integer
For i = 1 To Sheets.Count
For j = 1 To Sheets.Count - 1
If UCase(Sheets(j).Name) > UCase(Sheets(j + 1).Name) Then Sheets(j).Move After:=Sheets(j + 1)
Next j
Next i
The results was the following sorting:
Sheet1, Sheet10, Sheet11, Sheet12, Sheet13, Sheet14, Sheet15, Sheet2, Sheet3,..., Sheet9.
My question is would it be possible to sort worksheet in a numerical order
i.e.
1,2,3,4,5,....15.
Thanks in advance for your help.
I have read several posts where it is possible to sort worksheets in an alphabetical order.
I would like to sort worksheets where there are 15 sheets named let's say 'Sheet1', 'Sheet2',..., 'Sheet15'.
Using the following code that I seen in another thread:
Sub Test1()
Dim i As Integer, j , As Integer
For i = 1 To Sheets.Count
For j = 1 To Sheets.Count - 1
If UCase(Sheets(j).Name) > UCase(Sheets(j + 1).Name) Then Sheets(j).Move After:=Sheets(j + 1)
Next j
Next i
The results was the following sorting:
Sheet1, Sheet10, Sheet11, Sheet12, Sheet13, Sheet14, Sheet15, Sheet2, Sheet3,..., Sheet9.
My question is would it be possible to sort worksheet in a numerical order
i.e.
1,2,3,4,5,....15.
Thanks in advance for your help.