OK -- I need to sort worksheets in excel with a macro. Ihave about hundred worksheet in one workbook. When we add a new worksheet I need to then be sorted. They are numbered sheet with the expection of one called "master sheet" One last thing- the one called "master sheet" needs to stay at the beging of the numbered sheets.
This is what I came up with but it sorts the master sheet to end.
Dim Cnt%, A%, B%
Cnt = ActiveWorkbook.Worksheets.Count
For B = 1 To Cnt
For A = B To Cnt
If Worksheets(A).Name < Worksheets(B).Name Then
Worksheets(A).move Before:=Worksheets(B)
End If
Next A
Next B
Any ideas......
This is what I came up with but it sorts the master sheet to end.
Dim Cnt%, A%, B%
Cnt = ActiveWorkbook.Worksheets.Count
For B = 1 To Cnt
For A = B To Cnt
If Worksheets(A).Name < Worksheets(B).Name Then
Worksheets(A).move Before:=Worksheets(B)
End If
Next A
Next B
Any ideas......