I am trying to copy a template worksheet called "Template" to worksheets that already exist but are blank. The reason I have worksheets alreay their is that I used a macro to create worksheets based on the a list that I had. Now that I have 50 worksheets, I would them to be formatted with the column widths and formulas from the template. I created a macro using the "record macro" feature and it works but it always copies the template to the worksheet that I created the macro with. here is the macro:
Sub Copy_template()
'
' Copy_template Macro
'
' Keyboard Shortcut: Ctrl+t
'
Sheets("Template").Select
Cells.Select
Selection.Copy
Sheets("6E4P9").Select
Cells.Select
Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveSheet.Paste
End Sub
The line "Sheets("6E4P9").Select" is what I need to fix. 6E4P9 is the worksheet name of the sheet I was on when I created the macro. I need to change it to the current worksheet. This will allow the macro to copy the template to the current worksheet that I am going to work on.
Please help
Thanks in advance
Sub Copy_template()
'
' Copy_template Macro
'
' Keyboard Shortcut: Ctrl+t
'
Sheets("Template").Select
Cells.Select
Selection.Copy
Sheets("6E4P9").Select
Cells.Select
Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveSheet.Paste
End Sub
The line "Sheets("6E4P9").Select" is what I need to fix. 6E4P9 is the worksheet name of the sheet I was on when I created the macro. I need to change it to the current worksheet. This will allow the macro to copy the template to the current worksheet that I am going to work on.
Please help
Thanks in advance