Hi, I have the following VBA
The list can be found from F1 to F23 (including headers, so data starts from F2), on sheet "Lookup"
And the sheet being copied and renamed according to the list is named "Template"
When running, the sheets paste as Template , 23 times, when previously it used to rename the copied sheet according to my list.
This used to work, but I have made some changes to Template, instead of being 1 page, it is now 3 pages (I set up print areas) and I'm not sure if this is causing the bug or not.
VBA Code:
Sub CopyTemplate()
Dim wTemplate As Worksheet
Dim wLIST As Worksheet
Dim wCopy As Worksheet
Dim r As Long
Dim m As Long
Application.ScreenUpdating = False
Set wTemplate = Worksheets("Template")
Set wLIST = Worksheets("Lookup")
m = wLIST.Range("F1").End(xlDown).Row
For r = 2 To m
wTemplate.Copy After:=Worksheets(Worksheets.Count)
Worksheets(Worksheets.Count).Name = wLIST.Range("F" & r).Value
Next r
Application.ScreenUpdating = True
End Sub
The list can be found from F1 to F23 (including headers, so data starts from F2), on sheet "Lookup"
And the sheet being copied and renamed according to the list is named "Template"
When running, the sheets paste as Template , 23 times, when previously it used to rename the copied sheet according to my list.
This used to work, but I have made some changes to Template, instead of being 1 page, it is now 3 pages (I set up print areas) and I'm not sure if this is causing the bug or not.