Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 159
Default Insert Worksheets from List in Another Worksheet

I list of names in column A of a Worksheet. I want to create a series of
worksheets in another document using that list of names, all with the same
format as the main sheet. Is there a way to do that?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Insert Worksheets from List in Another Worksheet

It's possible, but is that other workbook an existing workbook (what is its
name)--or a new workbook?

Where is that main sheet and what is its name?

Larry wrote:

I list of names in column A of a Worksheet. I want to create a series of
worksheets in another document using that list of names, all with the same
format as the main sheet. Is there a way to do that?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 159
Default Insert Worksheets from List in Another Worksheet

Basically, I want to create an exact duplicate of a spreadsheet for each
provider, I know how to copy and paste into multiple worksheets at once, so I
guess what I need is a quick way to take the list of 98 names and make a
blank worksheet for each name into a new workbook.

"Dave Peterson" wrote:

It's possible, but is that other workbook an existing workbook (what is its
name)--or a new workbook?

Where is that main sheet and what is its name?

Larry wrote:

I list of names in column A of a Worksheet. I want to create a series of
worksheets in another document using that list of names, all with the same
format as the main sheet. Is there a way to do that?


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Insert Worksheets from List in Another Worksheet

This will create a new worksheet in the same workbook for each name in A1:Axx of
Sheet1:

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim myRng As Range
Dim myCell As Range

Set wks = Worksheets("Sheet1") '<-- sheet with the names

With wks
Set myRng = .Range("A1", .Cells(.Rows.Count, "A").End(xlUp))
End With

For Each myCell In myRng.Cells
On Error Resume Next
Worksheets.Add.Name = myCell.Value
If Err.Number < 0 Then
MsgBox "Couldn't rename: " & ActiveSheet.Name _
& " to " & myCell.Value
Err.Clear
End If
On Error GoTo 0
Next myCell
End Sub

Larry wrote:

Basically, I want to create an exact duplicate of a spreadsheet for each
provider, I know how to copy and paste into multiple worksheets at once, so I
guess what I need is a quick way to take the list of 98 names and make a
blank worksheet for each name into a new workbook.

"Dave Peterson" wrote:

It's possible, but is that other workbook an existing workbook (what is its
name)--or a new workbook?

Where is that main sheet and what is its name?

Larry wrote:

I list of names in column A of a Worksheet. I want to create a series of
worksheets in another document using that list of names, all with the same
format as the main sheet. Is there a way to do that?


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Insert Worksheets from List in Another Worksheet

Dave

But that won't copy a formatted sheet.

Just adds new default sheets.

Here is a macro you posted a couple or few years ago.......................

Sub CreateNameSheets()
' by Dave Peterson
' List sheetnames required in col A in a sheet: List
' Sub will copy sheets based on the sheet named as: Template
' and name the sheets accordingly

Dim TemplateWks As Worksheet
Dim ListWks As Worksheet
Dim ListRng As Range
Dim mycell As Range

Set TemplateWks = Worksheets("Template")
Set ListWks = Worksheets("list")
With ListWks
Set ListRng = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp))
End With

For Each mycell In ListRng.Cells
TemplateWks.Copy After:=Worksheets(Worksheets.Count)
On Error Resume Next
ActiveSheet.Name = mycell.Value
If Err.Number < 0 Then
MsgBox "Please fix: " & ActiveSheet.Name
Err.Clear
End If
On Error GoTo 0
Next mycell

End Sub


Gord Dibben MS Excel MVP

On Wed, 02 Sep 2009 12:04:56 -0500, Dave Peterson
wrote:

This will create a new worksheet in the same workbook for each name in A1:Axx of
Sheet1:

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim myRng As Range
Dim myCell As Range

Set wks = Worksheets("Sheet1") '<-- sheet with the names

With wks
Set myRng = .Range("A1", .Cells(.Rows.Count, "A").End(xlUp))
End With

For Each myCell In myRng.Cells
On Error Resume Next
Worksheets.Add.Name = myCell.Value
If Err.Number < 0 Then
MsgBox "Couldn't rename: " & ActiveSheet.Name _
& " to " & myCell.Value
Err.Clear
End If
On Error GoTo 0
Next myCell
End Sub

Larry wrote:

Basically, I want to create an exact duplicate of a spreadsheet for each
provider, I know how to copy and paste into multiple worksheets at once, so I
guess what I need is a quick way to take the list of 98 names and make a
blank worksheet for each name into a new workbook.

"Dave Peterson" wrote:

It's possible, but is that other workbook an existing workbook (what is its
name)--or a new workbook?

Where is that main sheet and what is its name?

Larry wrote:

I list of names in column A of a Worksheet. I want to create a series of
worksheets in another document using that list of names, all with the same
format as the main sheet. Is there a way to do that?

--

Dave Peterson




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Insert Worksheets from List in Another Worksheet

I tried my best to get the OP to share the name of that template worksheet.

But he wouldn't <bg. In fact, he wrote:
...make a
blank worksheet for each name into a new workbook.


I'm not sure if a new workbook was really needed, either--or if it was supposed
to be a new workbook for each name...


Gord Dibben wrote:

Dave

But that won't copy a formatted sheet.

Just adds new default sheets.

Here is a macro you posted a couple or few years ago.......................

Sub CreateNameSheets()
' by Dave Peterson
' List sheetnames required in col A in a sheet: List
' Sub will copy sheets based on the sheet named as: Template
' and name the sheets accordingly

Dim TemplateWks As Worksheet
Dim ListWks As Worksheet
Dim ListRng As Range
Dim mycell As Range

Set TemplateWks = Worksheets("Template")
Set ListWks = Worksheets("list")
With ListWks
Set ListRng = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp))
End With

For Each mycell In ListRng.Cells
TemplateWks.Copy After:=Worksheets(Worksheets.Count)
On Error Resume Next
ActiveSheet.Name = mycell.Value
If Err.Number < 0 Then
MsgBox "Please fix: " & ActiveSheet.Name
Err.Clear
End If
On Error GoTo 0
Next mycell

End Sub

Gord Dibben MS Excel MVP

On Wed, 02 Sep 2009 12:04:56 -0500, Dave Peterson
wrote:

This will create a new worksheet in the same workbook for each name in A1:Axx of
Sheet1:

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim myRng As Range
Dim myCell As Range

Set wks = Worksheets("Sheet1") '<-- sheet with the names

With wks
Set myRng = .Range("A1", .Cells(.Rows.Count, "A").End(xlUp))
End With

For Each myCell In myRng.Cells
On Error Resume Next
Worksheets.Add.Name = myCell.Value
If Err.Number < 0 Then
MsgBox "Couldn't rename: " & ActiveSheet.Name _
& " to " & myCell.Value
Err.Clear
End If
On Error GoTo 0
Next myCell
End Sub

Larry wrote:

Basically, I want to create an exact duplicate of a spreadsheet for each
provider, I know how to copy and paste into multiple worksheets at once, so I
guess what I need is a quick way to take the list of 98 names and make a
blank worksheet for each name into a new workbook.

"Dave Peterson" wrote:

It's possible, but is that other workbook an existing workbook (what is its
name)--or a new workbook?

Where is that main sheet and what is its name?

Larry wrote:

I list of names in column A of a Worksheet. I want to create a series of
worksheets in another document using that list of names, all with the same
format as the main sheet. Is there a way to do that?

--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot insert worksheet in exel - not available in insert menu pedro39 Excel Worksheet Functions 1 July 24th 08 12:09 PM
Can Excel list all of a workbook's worksheets on a worksheet? [email protected] Excel Worksheet Functions 2 April 3rd 08 12:14 AM
How to insert formulas from four worksheets into one worksheet Corinne Excel Worksheet Functions 1 November 1st 07 07:06 PM
How do I insert a drop down list button from an excel worksheet? Visiting Angel Excel Worksheet Functions 2 September 25th 06 10:19 PM
Create a list in one worksheet of the other worksheets' names Kelli Excel Worksheet Functions 0 July 7th 05 08:45 PM


All times are GMT +1. The time now is 01:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"