I have a Macros that creates a copy of a Template worksheet, prompts
the user for a Workorder number, then inserts a sheet with the name as
the Workorder number (ie. 123456).
What I would like to be able to do is insert this sheet into its
correct position. ie. if a user has already inserted two worksheets
named 1234567 and 8901234, if they then try and insert a new worksheet
titled 4567890, I would like it to insert itself in between the other
two workorder numbers. This will make it easier to find.
Currently is is simply inserted after a sheet titled
like to still have the sheet inserted after the Materials sheet, but
be inserted in its proper numerical position after that sheet.
Here is my code currently. Thank you for any
WorkorderNumber = InputBox("This will create an auto-generating
Workorder Tracking Sheet for all children of a Parent Workorder.
Please enter Parent Workorder Number", "CREATE WORKORDER TRACKING
If WorkorderNumber = "" Then
MsgBox "Nothing Entered", vbOKOnly, "Cancelling..."
On Error Resume Next
ActiveSheet.Name = WorkorderNumber
ActiveCell.FormulaR1C1 = WorkorderNumber
If Err.Number > 0 Then
MsgBox "Please Enter a Different Workorder Number", vbOKOnly,
"Sheet Already Exists"
Application.DisplayAlerts = False
Application.DisplayAlerts = True
On Error GoTo 0