I need to know how to sort my tabs or sheets. the thing is i have a code that sorts ALL of my sheets alphabetically, but i need this macro to leave the others as is, and just sort the new sheet.
This is my create sheet macro, it works great, but it throws it at the end of my workbook. i need it to put it alphabetically with the others.
Sub createsheet()
Dim SearchData As String
Application.ScreenUpdating = False
SearchData = InputBox("Enter the tag number.")
Sheets("NEW").Copy Before:=Sheets("NEW")
Sheets("NEW (2)").Activate
ActiveSheet.Name = SearchData
Sheets("INVENTORY").Activate
Range("B5").Select
Selection.AutoFill Destination:=Range("B5:B731"), Type:=xlFillDefault
Range("B5:B731").Select
Sheets("autoship").Activate
End Sub
this is my sort sheets macro, but i dont want to do this every time i create one single sheet as it takes about 10 minutes for this macro to finish.
Sub SortSheets()
Dim i, j As Integer
Dim iNumSheets As Integer
iNumSheets = ActiveWorkbook.Sheets.Count
Application.ScreenUpdating = False
For i = 1 To iNumSheets - 1
For j = i + 1 To iNumSheets
If UCase(Sheets(i).Name) > UCase(Sheets(j).Name) Then
Sheets(j).Move Before:=Sheets(i)
End If
Next j
Next i
Application.ScreenUpdating = True
End Sub
thanks in advance
Bookmarks