Creating New Tabs based on a Template and a List

cotatliad

New Member
Joined
Jul 6, 2011
Messages
19
Hello there!

I need to create multiple copies of a template worksheet I got and name each copy based on a list I have. Is there a quick way of doing it? (Note, I have virtually no VB skills).

Thank you very much!
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I'll assume "virtually no" means you know where to put the code.. :) You can try the below code. Just make sure you have a sheet titled "Template" or adjust the code to suit your needs. Then, on whatever tab you have your list, highlight the cells and it will make tabs for each cell that you have highlighted.

You'll get errors on blanks, just reply and we can modify code to work around it.

Code:
Sub MakeSheets()
Application.ScreenUpdating = False
Application.Calculation = xlManual
 
Dim StartingSheet As String
StartingSheet = ActiveSheet.Name
 
For Each c In Selection
    Sheets("Template").Copy After:=Sheets(Sheets.count)
    Sheets("Template (2)").Name = c.Value
Next c
 
Sheets(StartingSheet).Select
 
Application.Calculation = xlAutomatic
Application.ScreenUpdating = True
 
MsgBox "Done"
End Sub
 
Upvote 0
A minor change to account for blanks in the list should you need it.

Code:
Sub MakeSheets()
Application.ScreenUpdating = False
Application.Calculation = xlManual
 
Dim StartingSheet As String
StartingSheet = ActiveSheet.Name
 
For Each c In Selection
    If c.Value <> "" Then
        Sheets("Template").Copy After:=Sheets(Sheets.Count)
        Sheets("Template (2)").Name = c.Value
    End If
Next c
 
Sheets(StartingSheet).Select
 
Application.Calculation = xlAutomatic
Application.ScreenUpdating = True
 
MsgBox "Done"
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,833
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top