For your first question replace the similar code (module 9) with this new code:
Public Sub AddSheet()
Dim shName As String, newsht As String
Dim shExists As Boolean
Do
shName = InputBox("Please Enter the Item Serial number")
If shName <> "" Then
shExists = SheetExists(shName)
If Not shExists Then
newsht = Sheets("new sheet").Copy(after:=Worksheets(Worksheets.Count))
Sheets(Worksheets.Count).Name = shName
Else
MsgBox "Worksheet " & shName & " already exists", vbOKOnly + vbInformation, "Add Sheet"
End If
End If
Loop Until Not shExists Or shName = ""
End Sub
For your second question replace the similar code (module 2) with:
Sub GotoSheet()
' Jumping between Worksheets
Dim sSheet As String
sSheet = InputBox( _
Prompt:="Serial number?", _
Title:="Serial Search Box")
On Error Resume Next
If sSheet = vbCancel Then Exit Sub
If Val(sSheet) > 9999999999999# Then
Worksheets(Val(sSheet)).Activate
Else
msg = MsgBox("Serial not found, would you like to enter a new one?", vbYesNo)
If msg = vbYes Then
Call GotoSheet
Exit Sub
End If
Worksheets(sSheet).Activate
End If
End Sub
Bookmarks