Replicate master worksheet with different names

Hi - I would like to replicate worksheet titled "Master" in an Excel workbook to various tabs, each tab should receive a name which will be listed in Column A of worksheet titled "List".  For example, cell A1 = "apples", cell A2 = "oranges", cell A3 = "pears", etc... The code should look at column A and automatically know how many worksheets to create based on the list of names.  There will be no spaces between each cell.  Thansk in advance!
eklinAsked:
Who is Participating?
 
tdlewisCommented:
This macro will accomplish the task:
Sub CreateFromMaster()
Dim i As Long
Dim oSheet As Worksheet

    Set oSheet = Sheets("Master")
    For i = 1 To oSheet.Range("A" & oSheet.Rows.Count).End(-4162).Row
        Sheets.Add After:=Sheets(Sheets.Count)
        ActiveSheet.Name = oSheet.Cells(i, 1).Value
    Next i
End Sub

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.