Easy way to create a bunch of worksheets and name them

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

Let's say I have a workbook and want to create 60 or so
worksheets. But I don't want to go in a name them after I
create them. What if I had a list of names...like in a
column. Then I wanted to run a macro that would create a
worksheet for each name in the list and name it.

What would the code look like?
 
Frank

it might look something like this:

Sub InsertSheets()
Dim Cell As Range
Dim NewSheet As Worksheet
For Each Cell In Range("A1:A" & Range("A65536").End(xlUp).Row)
Set NewSheet = _
Sheets.Add(After:=Sheets(Worksheets.Count))
NewSheet.Name = Cell.Value
Next Cell
End Sub

Regards

Trevor
 
Back
Top