Hi all
I have the following code but need to tweak it so that on the 2nd time it runs, it no longer creates every single sheet, but only new sheets (not yet on the workbook). Can anyone help? The purpose is to create new sheets based on sheet 'Template'. Also I'm having some trouble on the macro to just run through Range "B2:B6" it seems like it goes all the way down in column B... Thanks in advance!!
Sub CreateSheetsFromAList2()
Dim ws1 As Worksheet
Set ws1 = ThisWorkbook.Worksheets("Template")
Dim MyCell As Range, MyRange As Range
Set MyRange = Sheets("Advertisers").Range("B2:B6")
Set MyRange = Range(MyRange, MyRange.End(xlDown))
For Each MyCell In MyRange
ws1.Copy ThisWorkbook.Sheets(Sheets.Count)
ThisWorkbook.Worksheets("Template (2)").Name = MyCell.Value
Next MyCell
End Sub
I have the following code but need to tweak it so that on the 2nd time it runs, it no longer creates every single sheet, but only new sheets (not yet on the workbook). Can anyone help? The purpose is to create new sheets based on sheet 'Template'. Also I'm having some trouble on the macro to just run through Range "B2:B6" it seems like it goes all the way down in column B... Thanks in advance!!
Sub CreateSheetsFromAList2()
Dim ws1 As Worksheet
Set ws1 = ThisWorkbook.Worksheets("Template")
Dim MyCell As Range, MyRange As Range
Set MyRange = Sheets("Advertisers").Range("B2:B6")
Set MyRange = Range(MyRange, MyRange.End(xlDown))
For Each MyCell In MyRange
ws1.Copy ThisWorkbook.Sheets(Sheets.Count)
ThisWorkbook.Worksheets("Template (2)").Name = MyCell.Value
Next MyCell
End Sub