Sub Add_Sheets()
Dim rCell As Range
For Each rCell In Range("A7:A20")
With Worksheets.Add(After:=Worksheets(Worksheets.Count))
.Name = rCell.Value
End With
Next rCell
End Sub
Gord Dibben MS Excel MVP
On Fri, 5 Mar 2010 12:29:10 -0800, Bishop <(E-Mail Removed)>
wrote:
>I have a range of cells (say A7:A20). Each cell has a persons name. I need
>to write code that will go through each cell, copy the name, create a new
>worksheet (in the same workbook), and name the worksheet using the copied
>name. So in this case, for example, after the code executes I would have my
>original worksheet with the names in cells A7:A20 and I would have 14 more
>sheets, each with one of the names from the range of cells.
|