Option Explicit Sub NewPage2() Dim NewWorkSheetName As String Dim Message1 As String Dim Title1 As String Dim DefaultTxt As String Dim MyInput As String Message1 = "Please enter the date to be used on the new Worksheet (Following the below format):" Title1 = "Create New Worksheet" DefaultTxt = "01.01.12" MyInput = InputBox(Message1, Title1, DefaultTxt) NewWorkSheetName = MyInput Worksheets.Add After:=Worksheets(Worksheets.Count) Worksheets(Worksheets.Count).Name = NewWorkSheetName Worksheets("Template").Select ActiveSheet.Copy Worksheets(NewWorkSheetName).Select ActiveSheet.Paste End SubIf I delete the bottom 4 Lines, it will create a new blank worksheet named after what I input into the InputBox. I just cannot seem to get it to copy the Template worksheet and Paste it into the newly created worksheet. Any help, as always, would be greatly appreciated!
this is a worksheet in the workbook I am inserting it into.
Even if I click Yes, Cancel or choose No at the message screen the sheet is added to the workbook but I get a Code:in the cell with the above code, even though that worksheet exists in the workbook I just inserted it into.
If I go to the Formula bar and click Edit Formula and click enter it fixes the Code:issue and points to the worksheet cell.
Any ideas on how I can avoid this happening, so that it inserts it and 'updates' the formula.
Also I am using a macro to insert the template (same issues):
Code:Sub Insert_NewClient_Template() Dim sh As Worksheet Dim shName As String 'name of the sheet template shName = "ddsd.xlt" 'Insert sheet template With ThisWorkbook Set sh = Sheets.Add(Type:=Application.TemplatesPath & shName, _ after:=.Sheets(.Sheets.Count)) End With 'Give the sheet a name On Error Resume Next sh.Name = InputBox("Enter sheet name " & s & " of " & SheetCount, _ " NEW SHEET NAME") If Err.Number > 0 Then MsgBox "Change the name of Sheet : " & sh.Name & " manually" Err.Clear End If On Error GoTo 0 End SubIs there a way to suppress the Message Box ('The workbook you opened contains automatic links to information in another workbook...' )?