DaveInIowa
Programmer
Is there a more straightforward method than the code I have listed below to create a new worksheet from an existing template worksheet and then assign the new worksheet to a variable?
I don't like the fact that I'm relying on the newly created worksheet to have the template's name appended with " (2)". It seems as though there should be a way to assign the variable directly from the .Copy method.
Code:
Public Sub CopyWorksheetFromTemplate()
Dim NewWorksheet As Worksheet
Dim Template As Worksheet
Set Template = ThisWorkbook.Worksheets("Template")
Template.Copy , Template
Set NewWorksheet = ThisWorkbook.Worksheets("Template (2)")
NewWorksheet.Name = "New WS Name"
' Code to fill NewWorkheet with data ...
End Sub