Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Create new workbook and new worksheet and close. Worksheet not saved | Excel Programming | |||
Create new workbook and new worksheet and close. Worksheet not sav | Excel Programming | |||
Create new workbook and new worksheet and close. Worksheet not sav | Excel Worksheet Functions | |||
Macro to Create New Worksheet and Reference Cell in Old Worksheet As Tab Name - "Object Required" Error | Excel Discussion (Misc queries) | |||
Can I create a worksheet menu to select each other worksheet | Excel Discussion (Misc queries) |