[FONT="]I have a macro that duplicates a template worksheet. When I run the macro I have a series of input boxes. The macro is supposed to be placing the information entered into those input boxes into the specified cells on the newly duplicated template sheet which is named after whatever the user puts into the tab name input box.
[/FONT]
[FONT="]Instead what's happening is that the template sheet gets copied as "template (2)" and the information from the input boxes is being entered into an unrelated sheet in the workbook. The unrelated sheet is hidden and is the last tab in the book. That hidden sheet is also being renamed as whatever is being entered into the "tab name" input box.
[/FONT]
[FONT="]Ideally, I just want the new template sheet to be placed between two hidden placeholder sheets named "Start" and "End". Can anyone help with this, please? The macro was working fine before when it's primary function was to copy and paste a specified range from the template sheet onto a new sheet, but once I changed the macro so that it would duplicate the template sheet, these issues occurred. Below is the relevant code:
Any help you can provide would be greatly appreciated and if there's any extra info that I can provide to help clear up anything that isn't clear please let me know. [/FONT]
[/FONT]
[FONT="]Instead what's happening is that the template sheet gets copied as "template (2)" and the information from the input boxes is being entered into an unrelated sheet in the workbook. The unrelated sheet is hidden and is the last tab in the book. That hidden sheet is also being renamed as whatever is being entered into the "tab name" input box.
[/FONT]
[FONT="]Ideally, I just want the new template sheet to be placed between two hidden placeholder sheets named "Start" and "End". Can anyone help with this, please? The macro was working fine before when it's primary function was to copy and paste a specified range from the template sheet onto a new sheet, but once I changed the macro so that it would duplicate the template sheet, these issues occurred. Below is the relevant code:
Code:
[FONT="]On Error Resume Next[/FONT][/FONT]
[FONT="] tabName = InputBox("Enter a name for this tab, do not use spaces and do not use full name [Abbreviate]") newName = InputBox("Object Name?") StrType = InputBox("What Type of Object is This?") StrCom = InputBox("Is this Object a Content Comparable or a Local Comparable?") strCity = InputBox("Object City? If unknown, enter ''0'' and delete within sheet") StrState = InputBox("Object State?") lngAtt = InputBox("Object Attendance? If unknown, enter ''0'' and delete within sheet") IngAP = InputBox("Object Price? If free enter ''0''") IngMSA = InputBox("MSA of Object Location? If unknown, enter ''0'' and delete within sheet") IngONV = InputBox("Annual Overnight Visitors?") IngExSqft = InputBox("Object Total Size? If unknown, enter ''0'' and delete within sheet") IngTaxYear = InputBox("Year?") On Error GoTo 0 If newName = "" Or newName = "False" Then Exit Sub Application.ScreenUpdating = False Sheets("Template").Copy After:=Sheets(ThisWorkbook.Worksheets.Count) Set wsNew = Sheets(ThisWorkbook.Worksheets.Count) With wsNew .Name = tabName 'Fill in the info somewhere on this sheet If strCity <> "" Then .Range("A2").Value = strCity & ", " & StrState End If .Range("A1").Value = newName .Range("AB2").Value = lngAtt .Range("AC2").Value = IngMSA .Range("AD2").Value = IngExSqft .Range("H1").Value = IngTaxYear [/FONT][FONT="][FONT="] End With[/FONT]
Any help you can provide would be greatly appreciated and if there's any extra info that I can provide to help clear up anything that isn't clear please let me know. [/FONT]