Try this...
Sub Insert_Sheet()
Dim strName As String
Dim i As Long
Const shTemplate As String = "J:\copy_sheet_mall.xltm" 'Path and file name of the sheet template
strName = Application.InputBox("Enter sheet name", "Sheet Name", Type:=2)
If strName = "False" Then Exit Sub 'User canceled
If Evaluate("ISREF('" & strName & "'!A1)") Then 'Test if worksheet name exists
i = 2
Do Until Not Evaluate("ISREF('" & strName & "(" & i & ")'!A1)")
i = i + 1
Loop
MsgBox "Sheet name: " & strName & " alredy in use." & vbLf & vbLf & _
"Sheet renamed to: " & strName & "(" & i & ")", _
vbInformation, "Sheet Name Exists"
strName = strName & "(" & i & ")"
End If
'Insert sheet template
Sheets.Add(Type:=shTemplate, After:=Sheets(Sheets.Count)).Name = strName
End Sub
Bookmarks