Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Copy Sheet to many sheets at once

Afternoon,

I have a template sheet that I want to copy to many other sheets using a
macro. The other sheets all have unique sheet names.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 694
Default Copy Sheet to many sheets at once

Afternoon Sunnyskies:

You will have to give a little more information.

Where are the other sheets?
How do you know the names?
Are they in the same workbook?

Generally you do this:

activesheet.cells.copy worksheets("Sheet1").cells

to copy and paste

but if you know the names you can paste all at once as in

ActiveSheet.Cells.Copy
Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet7", "Sheet9")).Select
Sheets("Sheet2").Activate
Cells.Select
ActiveSheet.Paste


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

Afternoon,

I have a template sheet that I want to copy to many other sheets using a
macro. The other sheets all have unique sheet names.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Copy Sheet to many sheets at once

All the sheets are on one file.
The names of the other sheets are created by using a macro refering to a list.
This is the macro to create the other sheets and give them a name according
to the list.

Sub NameSheets()
'will add a sheet, and name it
'for each name in column A
'from B7 down till it hits a blank row

Dim Rng As Range
Dim ListRng As Range
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
With Worksheets
..Add(After:=.Item(.Count)).Name = Rng.Text
End With
End If
Next Rng
End Sub

And then I want to copy a template and paste into each of the sheets created.

I hope this will provide some guideance.

"Martin Fishlock" wrote:

Afternoon Sunnyskies:

You will have to give a little more information.

Where are the other sheets?
How do you know the names?
Are they in the same workbook?

Generally you do this:

activesheet.cells.copy worksheets("Sheet1").cells

to copy and paste

but if you know the names you can paste all at once as in

ActiveSheet.Cells.Copy
Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet7", "Sheet9")).Select
Sheets("Sheet2").Activate
Cells.Select
ActiveSheet.Paste


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

Afternoon,

I have a template sheet that I want to copy to many other sheets using a
macro. The other sheets all have unique sheet names.

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 694
Default Copy Sheet to many sheets at once

Have a look at this it needs a bit of tidying up and maybe tweeking.

but it copies the template this is in the current workbook with a name
Template (modify as required).

Sub NameSheets()
'will add a sheet, and name it
'for each name in column A
'from B7 down till it hits a blank row

dim wstemp as worksheet
Dim Rng As Range
Dim ListRng As Range
set wstemp = worksheets("Template") ' this is the one to copy
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
wstemp.copy After:=worksheets(Worksheets.Count)
worksheets(Worksheets.Count).Name = Rng.Text
End If
Next Rng
End Sub

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

All the sheets are on one file.
The names of the other sheets are created by using a macro refering to a list.
This is the macro to create the other sheets and give them a name according
to the list.

Sub NameSheets()
'will add a sheet, and name it
'for each name in column A
'from B7 down till it hits a blank row

Dim Rng As Range
Dim ListRng As Range
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
With Worksheets
.Add(After:=.Item(.Count)).Name = Rng.Text
End With
End If
Next Rng
End Sub

And then I want to copy a template and paste into each of the sheets created.

I hope this will provide some guideance.

"Martin Fishlock" wrote:

Afternoon Sunnyskies:

You will have to give a little more information.

Where are the other sheets?
How do you know the names?
Are they in the same workbook?

Generally you do this:

activesheet.cells.copy worksheets("Sheet1").cells

to copy and paste

but if you know the names you can paste all at once as in

ActiveSheet.Cells.Copy
Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet7", "Sheet9")).Select
Sheets("Sheet2").Activate
Cells.Select
ActiveSheet.Paste


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

Afternoon,

I have a template sheet that I want to copy to many other sheets using a
macro. The other sheets all have unique sheet names.

Thanks

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Copy Sheet to many sheets at once

Maybe just copying the template (a worksheet in the same workbook???) would be
sufficient:

Option Explicit
Sub testme01()
Dim TmpWks As Worksheet
Dim NewWks As Worksheet
Dim myCell As Range
Dim ListRng As Range

With Worksheets("sheet9999")
Set ListRng = .Range("B7", Range("B7").End(xlDown))
End With
Set TmpWks = Worksheets("Template")

With TmpWks
.Visible = xlSheetVisible
For Each myCell In ListRng.Cells
.Copy _
after:=Worksheets(Worksheets.Count)
Set NewWks = ActiveSheet
NewWks.Name = myCell.Value
Next myCell
.Visible = xlSheetHidden
End With
End Sub


Sunnyskies wrote:

All the sheets are on one file.
The names of the other sheets are created by using a macro refering to a list.
This is the macro to create the other sheets and give them a name according
to the list.

Sub NameSheets()
'will add a sheet, and name it
'for each name in column A
'from B7 down till it hits a blank row

Dim Rng As Range
Dim ListRng As Range
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
With Worksheets
.Add(After:=.Item(.Count)).Name = Rng.Text
End With
End If
Next Rng
End Sub

And then I want to copy a template and paste into each of the sheets created.

I hope this will provide some guideance.

"Martin Fishlock" wrote:

Afternoon Sunnyskies:

You will have to give a little more information.

Where are the other sheets?
How do you know the names?
Are they in the same workbook?

Generally you do this:

activesheet.cells.copy worksheets("Sheet1").cells

to copy and paste

but if you know the names you can paste all at once as in

ActiveSheet.Cells.Copy
Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet7", "Sheet9")).Select
Sheets("Sheet2").Activate
Cells.Select
ActiveSheet.Paste


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

Afternoon,

I have a template sheet that I want to copy to many other sheets using a
macro. The other sheets all have unique sheet names.

Thanks


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Copy Sheet to many sheets at once

Afternoon Martin,

Ran the addum macro, and it only runs for a specific number of sheets (44).

Then flags a run time error 1004
Method 'Copy' of object'_Worksheet failed

Do you perhaps have a solution?

Thanks


"Martin Fishlock" wrote:

Have a look at this it needs a bit of tidying up and maybe tweeking.

but it copies the template this is in the current workbook with a name
Template (modify as required).

Sub NameSheets()
'will add a sheet, and name it
'for each name in column A
'from B7 down till it hits a blank row

dim wstemp as worksheet
Dim Rng As Range
Dim ListRng As Range
set wstemp = worksheets("Template") ' this is the one to copy
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
wstemp.copy After:=worksheets(Worksheets.Count)
worksheets(Worksheets.Count).Name = Rng.Text
End If
Next Rng
End Sub

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

All the sheets are on one file.
The names of the other sheets are created by using a macro refering to a list.
This is the macro to create the other sheets and give them a name according
to the list.

Sub NameSheets()
'will add a sheet, and name it
'for each name in column A
'from B7 down till it hits a blank row

Dim Rng As Range
Dim ListRng As Range
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
With Worksheets
.Add(After:=.Item(.Count)).Name = Rng.Text
End With
End If
Next Rng
End Sub

And then I want to copy a template and paste into each of the sheets created.

I hope this will provide some guideance.

"Martin Fishlock" wrote:

Afternoon Sunnyskies:

You will have to give a little more information.

Where are the other sheets?
How do you know the names?
Are they in the same workbook?

Generally you do this:

activesheet.cells.copy worksheets("Sheet1").cells

to copy and paste

but if you know the names you can paste all at once as in

ActiveSheet.Cells.Copy
Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet7", "Sheet9")).Select
Sheets("Sheet2").Activate
Cells.Select
ActiveSheet.Paste


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

Afternoon,

I have a template sheet that I want to copy to many other sheets using a
macro. The other sheets all have unique sheet names.

Thanks

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Copy Sheet to many sheets at once

Afternoon Dave,

After copying your macro I hit the following errors.

The command With Worksheet (''sheet9999") tells me out of range. Change to
250 and still does not function. So made it a comment line.
Then made End With also a comment line.
Now battling with the command line
..Copy _
after:=Worksheets(Worksheets.Count)
So altered it a little to .Copy_after:=Worksheets(Worksheet.Count)
Now I get the same run time error as Martins 1004, Method 'Copy' of
object_Worksheet' failed.

Some assistance please.

Thanks

"Dave Peterson" wrote:

Maybe just copying the template (a worksheet in the same workbook???) would be
sufficient:

Option Explicit
Sub testme01()
Dim TmpWks As Worksheet
Dim NewWks As Worksheet
Dim myCell As Range
Dim ListRng As Range

With Worksheets("sheet9999")
Set ListRng = .Range("B7", Range("B7").End(xlDown))
End With
Set TmpWks = Worksheets("Template")

With TmpWks
.Visible = xlSheetVisible
For Each myCell In ListRng.Cells
.Copy _
after:=Worksheets(Worksheets.Count)
Set NewWks = ActiveSheet
NewWks.Name = myCell.Value
Next myCell
.Visible = xlSheetHidden
End With
End Sub


Sunnyskies wrote:

All the sheets are on one file.
The names of the other sheets are created by using a macro refering to a list.
This is the macro to create the other sheets and give them a name according
to the list.

Sub NameSheets()
'will add a sheet, and name it
'for each name in column A
'from B7 down till it hits a blank row

Dim Rng As Range
Dim ListRng As Range
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
With Worksheets
.Add(After:=.Item(.Count)).Name = Rng.Text
End With
End If
Next Rng
End Sub

And then I want to copy a template and paste into each of the sheets created.

I hope this will provide some guideance.

"Martin Fishlock" wrote:

Afternoon Sunnyskies:

You will have to give a little more information.

Where are the other sheets?
How do you know the names?
Are they in the same workbook?

Generally you do this:

activesheet.cells.copy worksheets("Sheet1").cells

to copy and paste

but if you know the names you can paste all at once as in

ActiveSheet.Cells.Copy
Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet7", "Sheet9")).Select
Sheets("Sheet2").Activate
Cells.Select
ActiveSheet.Paste


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

Afternoon,

I have a template sheet that I want to copy to many other sheets using a
macro. The other sheets all have unique sheet names.

Thanks


--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Copy Sheet to many sheets at once

What's the name of the worksheet that contains the list?

I used sheet9999. You'd want to use the correct name.

I also named my template worksheet Template.

You'd want to change this line:
Set TmpWks = Worksheets("Template")



Sunnyskies wrote:

Afternoon Dave,

After copying your macro I hit the following errors.

The command With Worksheet (''sheet9999") tells me out of range. Change to
250 and still does not function. So made it a comment line.
Then made End With also a comment line.
Now battling with the command line
.Copy _
after:=Worksheets(Worksheets.Count)
So altered it a little to .Copy_after:=Worksheets(Worksheet.Count)
Now I get the same run time error as Martins 1004, Method 'Copy' of
object_Worksheet' failed.

Some assistance please.

Thanks

"Dave Peterson" wrote:

Maybe just copying the template (a worksheet in the same workbook???) would be
sufficient:

Option Explicit
Sub testme01()
Dim TmpWks As Worksheet
Dim NewWks As Worksheet
Dim myCell As Range
Dim ListRng As Range

With Worksheets("sheet9999")
Set ListRng = .Range("B7", Range("B7").End(xlDown))
End With
Set TmpWks = Worksheets("Template")

With TmpWks
.Visible = xlSheetVisible
For Each myCell In ListRng.Cells
.Copy _
after:=Worksheets(Worksheets.Count)
Set NewWks = ActiveSheet
NewWks.Name = myCell.Value
Next myCell
.Visible = xlSheetHidden
End With
End Sub


Sunnyskies wrote:

All the sheets are on one file.
The names of the other sheets are created by using a macro refering to a list.
This is the macro to create the other sheets and give them a name according
to the list.

Sub NameSheets()
'will add a sheet, and name it
'for each name in column A
'from B7 down till it hits a blank row

Dim Rng As Range
Dim ListRng As Range
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
With Worksheets
.Add(After:=.Item(.Count)).Name = Rng.Text
End With
End If
Next Rng
End Sub

And then I want to copy a template and paste into each of the sheets created.

I hope this will provide some guideance.

"Martin Fishlock" wrote:

Afternoon Sunnyskies:

You will have to give a little more information.

Where are the other sheets?
How do you know the names?
Are they in the same workbook?

Generally you do this:

activesheet.cells.copy worksheets("Sheet1").cells

to copy and paste

but if you know the names you can paste all at once as in

ActiveSheet.Cells.Copy
Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet7", "Sheet9")).Select
Sheets("Sheet2").Activate
Cells.Select
ActiveSheet.Paste


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

Afternoon,

I have a template sheet that I want to copy to many other sheets using a
macro. The other sheets all have unique sheet names.

Thanks


--

Dave Peterson


--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Copy Sheet to many sheets at once

Afternoon Dave,

I changed the sheet9999 to Parameters as this is where the list of names is,
then ran the macro, which went well, until it hit sheet number 44, then it
popped up the same error message as before : Method 'Copy' of
object_Worksheet' failed.


"Dave Peterson" wrote:

What's the name of the worksheet that contains the list?

I used sheet9999. You'd want to use the correct name.

I also named my template worksheet Template.

You'd want to change this line:
Set TmpWks = Worksheets("Template")



Sunnyskies wrote:

Afternoon Dave,

After copying your macro I hit the following errors.

The command With Worksheet (''sheet9999") tells me out of range. Change to
250 and still does not function. So made it a comment line.
Then made End With also a comment line.
Now battling with the command line
.Copy _
after:=Worksheets(Worksheets.Count)
So altered it a little to .Copy_after:=Worksheets(Worksheet.Count)
Now I get the same run time error as Martins 1004, Method 'Copy' of
object_Worksheet' failed.

Some assistance please.

Thanks

"Dave Peterson" wrote:

Maybe just copying the template (a worksheet in the same workbook???) would be
sufficient:

Option Explicit
Sub testme01()
Dim TmpWks As Worksheet
Dim NewWks As Worksheet
Dim myCell As Range
Dim ListRng As Range

With Worksheets("sheet9999")
Set ListRng = .Range("B7", Range("B7").End(xlDown))
End With
Set TmpWks = Worksheets("Template")

With TmpWks
.Visible = xlSheetVisible
For Each myCell In ListRng.Cells
.Copy _
after:=Worksheets(Worksheets.Count)
Set NewWks = ActiveSheet
NewWks.Name = myCell.Value
Next myCell
.Visible = xlSheetHidden
End With
End Sub


Sunnyskies wrote:

All the sheets are on one file.
The names of the other sheets are created by using a macro refering to a list.
This is the macro to create the other sheets and give them a name according
to the list.

Sub NameSheets()
'will add a sheet, and name it
'for each name in column A
'from B7 down till it hits a blank row

Dim Rng As Range
Dim ListRng As Range
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
With Worksheets
.Add(After:=.Item(.Count)).Name = Rng.Text
End With
End If
Next Rng
End Sub

And then I want to copy a template and paste into each of the sheets created.

I hope this will provide some guideance.

"Martin Fishlock" wrote:

Afternoon Sunnyskies:

You will have to give a little more information.

Where are the other sheets?
How do you know the names?
Are they in the same workbook?

Generally you do this:

activesheet.cells.copy worksheets("Sheet1").cells

to copy and paste

but if you know the names you can paste all at once as in

ActiveSheet.Cells.Copy
Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet7", "Sheet9")).Select
Sheets("Sheet2").Activate
Cells.Select
ActiveSheet.Paste


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

Afternoon,

I have a template sheet that I want to copy to many other sheets using a
macro. The other sheets all have unique sheet names.

Thanks

--

Dave Peterson


--

Dave Peterson

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Copy Sheet to many sheets at once

I tried it with 134 names and it worked fine.

What version of excel are you using?



Sunnyskies wrote:

Afternoon Dave,

I changed the sheet9999 to Parameters as this is where the list of names is,
then ran the macro, which went well, until it hit sheet number 44, then it
popped up the same error message as before : Method 'Copy' of
object_Worksheet' failed.

"Dave Peterson" wrote:

What's the name of the worksheet that contains the list?

I used sheet9999. You'd want to use the correct name.

I also named my template worksheet Template.

You'd want to change this line:
Set TmpWks = Worksheets("Template")



Sunnyskies wrote:

Afternoon Dave,

After copying your macro I hit the following errors.

The command With Worksheet (''sheet9999") tells me out of range. Change to
250 and still does not function. So made it a comment line.
Then made End With also a comment line.
Now battling with the command line
.Copy _
after:=Worksheets(Worksheets.Count)
So altered it a little to .Copy_after:=Worksheets(Worksheet.Count)
Now I get the same run time error as Martins 1004, Method 'Copy' of
object_Worksheet' failed.

Some assistance please.

Thanks

"Dave Peterson" wrote:

Maybe just copying the template (a worksheet in the same workbook???) would be
sufficient:

Option Explicit
Sub testme01()
Dim TmpWks As Worksheet
Dim NewWks As Worksheet
Dim myCell As Range
Dim ListRng As Range

With Worksheets("sheet9999")
Set ListRng = .Range("B7", Range("B7").End(xlDown))
End With
Set TmpWks = Worksheets("Template")

With TmpWks
.Visible = xlSheetVisible
For Each myCell In ListRng.Cells
.Copy _
after:=Worksheets(Worksheets.Count)
Set NewWks = ActiveSheet
NewWks.Name = myCell.Value
Next myCell
.Visible = xlSheetHidden
End With
End Sub


Sunnyskies wrote:

All the sheets are on one file.
The names of the other sheets are created by using a macro refering to a list.
This is the macro to create the other sheets and give them a name according
to the list.

Sub NameSheets()
'will add a sheet, and name it
'for each name in column A
'from B7 down till it hits a blank row

Dim Rng As Range
Dim ListRng As Range
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
With Worksheets
.Add(After:=.Item(.Count)).Name = Rng.Text
End With
End If
Next Rng
End Sub

And then I want to copy a template and paste into each of the sheets created.

I hope this will provide some guideance.

"Martin Fishlock" wrote:

Afternoon Sunnyskies:

You will have to give a little more information.

Where are the other sheets?
How do you know the names?
Are they in the same workbook?

Generally you do this:

activesheet.cells.copy worksheets("Sheet1").cells

to copy and paste

but if you know the names you can paste all at once as in

ActiveSheet.Cells.Copy
Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet7", "Sheet9")).Select
Sheets("Sheet2").Activate
Cells.Select
ActiveSheet.Paste


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

Afternoon,

I have a template sheet that I want to copy to many other sheets using a
macro. The other sheets all have unique sheet names.

Thanks

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Copy Sheet to many sheets at once

Morning Dave,

Use windows XP, how many times did you try.

Possible to e-mail to you?

Thanks

"Dave Peterson" wrote:

I tried it with 134 names and it worked fine.

What version of excel are you using?



Sunnyskies wrote:

Afternoon Dave,

I changed the sheet9999 to Parameters as this is where the list of names is,
then ran the macro, which went well, until it hit sheet number 44, then it
popped up the same error message as before : Method 'Copy' of
object_Worksheet' failed.

"Dave Peterson" wrote:

What's the name of the worksheet that contains the list?

I used sheet9999. You'd want to use the correct name.

I also named my template worksheet Template.

You'd want to change this line:
Set TmpWks = Worksheets("Template")



Sunnyskies wrote:

Afternoon Dave,

After copying your macro I hit the following errors.

The command With Worksheet (''sheet9999") tells me out of range. Change to
250 and still does not function. So made it a comment line.
Then made End With also a comment line.
Now battling with the command line
.Copy _
after:=Worksheets(Worksheets.Count)
So altered it a little to .Copy_after:=Worksheets(Worksheet.Count)
Now I get the same run time error as Martins 1004, Method 'Copy' of
object_Worksheet' failed.

Some assistance please.

Thanks

"Dave Peterson" wrote:

Maybe just copying the template (a worksheet in the same workbook???) would be
sufficient:

Option Explicit
Sub testme01()
Dim TmpWks As Worksheet
Dim NewWks As Worksheet
Dim myCell As Range
Dim ListRng As Range

With Worksheets("sheet9999")
Set ListRng = .Range("B7", Range("B7").End(xlDown))
End With
Set TmpWks = Worksheets("Template")

With TmpWks
.Visible = xlSheetVisible
For Each myCell In ListRng.Cells
.Copy _
after:=Worksheets(Worksheets.Count)
Set NewWks = ActiveSheet
NewWks.Name = myCell.Value
Next myCell
.Visible = xlSheetHidden
End With
End Sub


Sunnyskies wrote:

All the sheets are on one file.
The names of the other sheets are created by using a macro refering to a list.
This is the macro to create the other sheets and give them a name according
to the list.

Sub NameSheets()
'will add a sheet, and name it
'for each name in column A
'from B7 down till it hits a blank row

Dim Rng As Range
Dim ListRng As Range
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
With Worksheets
.Add(After:=.Item(.Count)).Name = Rng.Text
End With
End If
Next Rng
End Sub

And then I want to copy a template and paste into each of the sheets created.

I hope this will provide some guideance.

"Martin Fishlock" wrote:

Afternoon Sunnyskies:

You will have to give a little more information.

Where are the other sheets?
How do you know the names?
Are they in the same workbook?

Generally you do this:

activesheet.cells.copy worksheets("Sheet1").cells

to copy and paste

but if you know the names you can paste all at once as in

ActiveSheet.Cells.Copy
Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet7", "Sheet9")).Select
Sheets("Sheet2").Activate
Cells.Select
ActiveSheet.Paste


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

Afternoon,

I have a template sheet that I want to copy to many other sheets using a
macro. The other sheets all have unique sheet names.

Thanks

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Copy Sheet to many sheets at once

I don't think that emailing the workbook to me would help you.

What version of Excel are you using?

Sunnyskies wrote:

Morning Dave,

Use windows XP, how many times did you try.

Possible to e-mail to you?

Thanks

"Dave Peterson" wrote:

I tried it with 134 names and it worked fine.

What version of excel are you using?



Sunnyskies wrote:

Afternoon Dave,

I changed the sheet9999 to Parameters as this is where the list of names is,
then ran the macro, which went well, until it hit sheet number 44, then it
popped up the same error message as before : Method 'Copy' of
object_Worksheet' failed.

"Dave Peterson" wrote:

What's the name of the worksheet that contains the list?

I used sheet9999. You'd want to use the correct name.

I also named my template worksheet Template.

You'd want to change this line:
Set TmpWks = Worksheets("Template")



Sunnyskies wrote:

Afternoon Dave,

After copying your macro I hit the following errors.

The command With Worksheet (''sheet9999") tells me out of range. Change to
250 and still does not function. So made it a comment line.
Then made End With also a comment line.
Now battling with the command line
.Copy _
after:=Worksheets(Worksheets.Count)
So altered it a little to .Copy_after:=Worksheets(Worksheet.Count)
Now I get the same run time error as Martins 1004, Method 'Copy' of
object_Worksheet' failed.

Some assistance please.

Thanks

"Dave Peterson" wrote:

Maybe just copying the template (a worksheet in the same workbook???) would be
sufficient:

Option Explicit
Sub testme01()
Dim TmpWks As Worksheet
Dim NewWks As Worksheet
Dim myCell As Range
Dim ListRng As Range

With Worksheets("sheet9999")
Set ListRng = .Range("B7", Range("B7").End(xlDown))
End With
Set TmpWks = Worksheets("Template")

With TmpWks
.Visible = xlSheetVisible
For Each myCell In ListRng.Cells
.Copy _
after:=Worksheets(Worksheets.Count)
Set NewWks = ActiveSheet
NewWks.Name = myCell.Value
Next myCell
.Visible = xlSheetHidden
End With
End Sub


Sunnyskies wrote:

All the sheets are on one file.
The names of the other sheets are created by using a macro refering to a list.
This is the macro to create the other sheets and give them a name according
to the list.

Sub NameSheets()
'will add a sheet, and name it
'for each name in column A
'from B7 down till it hits a blank row

Dim Rng As Range
Dim ListRng As Range
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
With Worksheets
.Add(After:=.Item(.Count)).Name = Rng.Text
End With
End If
Next Rng
End Sub

And then I want to copy a template and paste into each of the sheets created.

I hope this will provide some guideance.

"Martin Fishlock" wrote:

Afternoon Sunnyskies:

You will have to give a little more information.

Where are the other sheets?
How do you know the names?
Are they in the same workbook?

Generally you do this:

activesheet.cells.copy worksheets("Sheet1").cells

to copy and paste

but if you know the names you can paste all at once as in

ActiveSheet.Cells.Copy
Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet7", "Sheet9")).Select
Sheets("Sheet2").Activate
Cells.Select
ActiveSheet.Paste


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

Afternoon,

I have a template sheet that I want to copy to many other sheets using a
macro. The other sheets all have unique sheet names.

Thanks

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Copy Sheet to many sheets at once

Microsoft Office Proffesional Edition 2003

"Dave Peterson" wrote:

I don't think that emailing the workbook to me would help you.

What version of Excel are you using?

Sunnyskies wrote:

Morning Dave,

Use windows XP, how many times did you try.

Possible to e-mail to you?

Thanks

"Dave Peterson" wrote:

I tried it with 134 names and it worked fine.

What version of excel are you using?



Sunnyskies wrote:

Afternoon Dave,

I changed the sheet9999 to Parameters as this is where the list of names is,
then ran the macro, which went well, until it hit sheet number 44, then it
popped up the same error message as before : Method 'Copy' of
object_Worksheet' failed.

"Dave Peterson" wrote:

What's the name of the worksheet that contains the list?

I used sheet9999. You'd want to use the correct name.

I also named my template worksheet Template.

You'd want to change this line:
Set TmpWks = Worksheets("Template")



Sunnyskies wrote:

Afternoon Dave,

After copying your macro I hit the following errors.

The command With Worksheet (''sheet9999") tells me out of range. Change to
250 and still does not function. So made it a comment line.
Then made End With also a comment line.
Now battling with the command line
.Copy _
after:=Worksheets(Worksheets.Count)
So altered it a little to .Copy_after:=Worksheets(Worksheet.Count)
Now I get the same run time error as Martins 1004, Method 'Copy' of
object_Worksheet' failed.

Some assistance please.

Thanks

"Dave Peterson" wrote:

Maybe just copying the template (a worksheet in the same workbook???) would be
sufficient:

Option Explicit
Sub testme01()
Dim TmpWks As Worksheet
Dim NewWks As Worksheet
Dim myCell As Range
Dim ListRng As Range

With Worksheets("sheet9999")
Set ListRng = .Range("B7", Range("B7").End(xlDown))
End With
Set TmpWks = Worksheets("Template")

With TmpWks
.Visible = xlSheetVisible
For Each myCell In ListRng.Cells
.Copy _
after:=Worksheets(Worksheets.Count)
Set NewWks = ActiveSheet
NewWks.Name = myCell.Value
Next myCell
.Visible = xlSheetHidden
End With
End Sub


Sunnyskies wrote:

All the sheets are on one file.
The names of the other sheets are created by using a macro refering to a list.
This is the macro to create the other sheets and give them a name according
to the list.

Sub NameSheets()
'will add a sheet, and name it
'for each name in column A
'from B7 down till it hits a blank row

Dim Rng As Range
Dim ListRng As Range
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
With Worksheets
.Add(After:=.Item(.Count)).Name = Rng.Text
End With
End If
Next Rng
End Sub

And then I want to copy a template and paste into each of the sheets created.

I hope this will provide some guideance.

"Martin Fishlock" wrote:

Afternoon Sunnyskies:

You will have to give a little more information.

Where are the other sheets?
How do you know the names?
Are they in the same workbook?

Generally you do this:

activesheet.cells.copy worksheets("Sheet1").cells

to copy and paste

but if you know the names you can paste all at once as in

ActiveSheet.Cells.Copy
Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet7", "Sheet9")).Select
Sheets("Sheet2").Activate
Cells.Select
ActiveSheet.Paste


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

Afternoon,

I have a template sheet that I want to copy to many other sheets using a
macro. The other sheets all have unique sheet names.

Thanks

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

  #14   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Copy Sheet to many sheets at once

I use xl2003 with windows XP (home), too.

I don't have a guess why it doesn't work for you.

Maybe it's time to split your data into smaller pieces and run it multiple
times?

Sunnyskies wrote:

Microsoft Office Proffesional Edition 2003

"Dave Peterson" wrote:

I don't think that emailing the workbook to me would help you.

What version of Excel are you using?

Sunnyskies wrote:

Morning Dave,

Use windows XP, how many times did you try.

Possible to e-mail to you?

Thanks

"Dave Peterson" wrote:

I tried it with 134 names and it worked fine.

What version of excel are you using?



Sunnyskies wrote:

Afternoon Dave,

I changed the sheet9999 to Parameters as this is where the list of names is,
then ran the macro, which went well, until it hit sheet number 44, then it
popped up the same error message as before : Method 'Copy' of
object_Worksheet' failed.

"Dave Peterson" wrote:

What's the name of the worksheet that contains the list?

I used sheet9999. You'd want to use the correct name.

I also named my template worksheet Template.

You'd want to change this line:
Set TmpWks = Worksheets("Template")



Sunnyskies wrote:

Afternoon Dave,

After copying your macro I hit the following errors.

The command With Worksheet (''sheet9999") tells me out of range. Change to
250 and still does not function. So made it a comment line.
Then made End With also a comment line.
Now battling with the command line
.Copy _
after:=Worksheets(Worksheets.Count)
So altered it a little to .Copy_after:=Worksheets(Worksheet.Count)
Now I get the same run time error as Martins 1004, Method 'Copy' of
object_Worksheet' failed.

Some assistance please.

Thanks

"Dave Peterson" wrote:

Maybe just copying the template (a worksheet in the same workbook???) would be
sufficient:

Option Explicit
Sub testme01()
Dim TmpWks As Worksheet
Dim NewWks As Worksheet
Dim myCell As Range
Dim ListRng As Range

With Worksheets("sheet9999")
Set ListRng = .Range("B7", Range("B7").End(xlDown))
End With
Set TmpWks = Worksheets("Template")

With TmpWks
.Visible = xlSheetVisible
For Each myCell In ListRng.Cells
.Copy _
after:=Worksheets(Worksheets.Count)
Set NewWks = ActiveSheet
NewWks.Name = myCell.Value
Next myCell
.Visible = xlSheetHidden
End With
End Sub


Sunnyskies wrote:

All the sheets are on one file.
The names of the other sheets are created by using a macro refering to a list.
This is the macro to create the other sheets and give them a name according
to the list.

Sub NameSheets()
'will add a sheet, and name it
'for each name in column A
'from B7 down till it hits a blank row

Dim Rng As Range
Dim ListRng As Range
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
With Worksheets
.Add(After:=.Item(.Count)).Name = Rng.Text
End With
End If
Next Rng
End Sub

And then I want to copy a template and paste into each of the sheets created.

I hope this will provide some guideance.

"Martin Fishlock" wrote:

Afternoon Sunnyskies:

You will have to give a little more information.

Where are the other sheets?
How do you know the names?
Are they in the same workbook?

Generally you do this:

activesheet.cells.copy worksheets("Sheet1").cells

to copy and paste

but if you know the names you can paste all at once as in

ActiveSheet.Cells.Copy
Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet7", "Sheet9")).Select
Sheets("Sheet2").Activate
Cells.Select
ActiveSheet.Paste


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

Afternoon,

I have a template sheet that I want to copy to many other sheets using a
macro. The other sheets all have unique sheet names.

Thanks

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #15   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Copy Sheet to many sheets at once

And I see you've started another thread elsewhere.

I'll bow out.

Dave Peterson wrote:

I use xl2003 with windows XP (home), too.

I don't have a guess why it doesn't work for you.

Maybe it's time to split your data into smaller pieces and run it multiple
times?

Sunnyskies wrote:

Microsoft Office Proffesional Edition 2003

"Dave Peterson" wrote:

I don't think that emailing the workbook to me would help you.

What version of Excel are you using?

Sunnyskies wrote:

Morning Dave,

Use windows XP, how many times did you try.

Possible to e-mail to you?

Thanks

"Dave Peterson" wrote:

I tried it with 134 names and it worked fine.

What version of excel are you using?



Sunnyskies wrote:

Afternoon Dave,

I changed the sheet9999 to Parameters as this is where the list of names is,
then ran the macro, which went well, until it hit sheet number 44, then it
popped up the same error message as before : Method 'Copy' of
object_Worksheet' failed.

"Dave Peterson" wrote:

What's the name of the worksheet that contains the list?

I used sheet9999. You'd want to use the correct name.

I also named my template worksheet Template.

You'd want to change this line:
Set TmpWks = Worksheets("Template")



Sunnyskies wrote:

Afternoon Dave,

After copying your macro I hit the following errors.

The command With Worksheet (''sheet9999") tells me out of range. Change to
250 and still does not function. So made it a comment line.
Then made End With also a comment line.
Now battling with the command line
.Copy _
after:=Worksheets(Worksheets.Count)
So altered it a little to .Copy_after:=Worksheets(Worksheet.Count)
Now I get the same run time error as Martins 1004, Method 'Copy' of
object_Worksheet' failed.

Some assistance please.

Thanks

"Dave Peterson" wrote:

Maybe just copying the template (a worksheet in the same workbook???) would be
sufficient:

Option Explicit
Sub testme01()
Dim TmpWks As Worksheet
Dim NewWks As Worksheet
Dim myCell As Range
Dim ListRng As Range

With Worksheets("sheet9999")
Set ListRng = .Range("B7", Range("B7").End(xlDown))
End With
Set TmpWks = Worksheets("Template")

With TmpWks
.Visible = xlSheetVisible
For Each myCell In ListRng.Cells
.Copy _
after:=Worksheets(Worksheets.Count)
Set NewWks = ActiveSheet
NewWks.Name = myCell.Value
Next myCell
.Visible = xlSheetHidden
End With
End Sub


Sunnyskies wrote:

All the sheets are on one file.
The names of the other sheets are created by using a macro refering to a list.
This is the macro to create the other sheets and give them a name according
to the list.

Sub NameSheets()
'will add a sheet, and name it
'for each name in column A
'from B7 down till it hits a blank row

Dim Rng As Range
Dim ListRng As Range
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
With Worksheets
.Add(After:=.Item(.Count)).Name = Rng.Text
End With
End If
Next Rng
End Sub

And then I want to copy a template and paste into each of the sheets created.

I hope this will provide some guideance.

"Martin Fishlock" wrote:

Afternoon Sunnyskies:

You will have to give a little more information.

Where are the other sheets?
How do you know the names?
Are they in the same workbook?

Generally you do this:

activesheet.cells.copy worksheets("Sheet1").cells

to copy and paste

but if you know the names you can paste all at once as in

ActiveSheet.Cells.Copy
Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet7", "Sheet9")).Select
Sheets("Sheet2").Activate
Cells.Select
ActiveSheet.Paste


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

Afternoon,

I have a template sheet that I want to copy to many other sheets using a
macro. The other sheets all have unique sheet names.

Thanks

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


  #16   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Copy Sheet to many sheets at once

Morning Dave,

I thought that broading my cry for help would provide more possible solutions.

I see that on http"//mcse.ms/message2392323.html you corrected a command line
MyWorkbook.Sheets.Add Type:="c:\path\templatefilename.xlt"

Where would I put this line on my macro?

Thanks

"Dave Peterson" wrote:

And I see you've started another thread elsewhere.

I'll bow out.

Dave Peterson wrote:

I use xl2003 with windows XP (home), too.

I don't have a guess why it doesn't work for you.

Maybe it's time to split your data into smaller pieces and run it multiple
times?

Sunnyskies wrote:

Microsoft Office Proffesional Edition 2003

"Dave Peterson" wrote:

I don't think that emailing the workbook to me would help you.

What version of Excel are you using?

Sunnyskies wrote:

Morning Dave,

Use windows XP, how many times did you try.

Possible to e-mail to you?

Thanks

"Dave Peterson" wrote:

I tried it with 134 names and it worked fine.

What version of excel are you using?



Sunnyskies wrote:

Afternoon Dave,

I changed the sheet9999 to Parameters as this is where the list of names is,
then ran the macro, which went well, until it hit sheet number 44, then it
popped up the same error message as before : Method 'Copy' of
object_Worksheet' failed.

"Dave Peterson" wrote:

What's the name of the worksheet that contains the list?

I used sheet9999. You'd want to use the correct name.

I also named my template worksheet Template.

You'd want to change this line:
Set TmpWks = Worksheets("Template")



Sunnyskies wrote:

Afternoon Dave,

After copying your macro I hit the following errors.

The command With Worksheet (''sheet9999") tells me out of range. Change to
250 and still does not function. So made it a comment line.
Then made End With also a comment line.
Now battling with the command line
.Copy _
after:=Worksheets(Worksheets.Count)
So altered it a little to .Copy_after:=Worksheets(Worksheet.Count)
Now I get the same run time error as Martins 1004, Method 'Copy' of
object_Worksheet' failed.

Some assistance please.

Thanks

"Dave Peterson" wrote:

Maybe just copying the template (a worksheet in the same workbook???) would be
sufficient:

Option Explicit
Sub testme01()
Dim TmpWks As Worksheet
Dim NewWks As Worksheet
Dim myCell As Range
Dim ListRng As Range

With Worksheets("sheet9999")
Set ListRng = .Range("B7", Range("B7").End(xlDown))
End With
Set TmpWks = Worksheets("Template")

With TmpWks
.Visible = xlSheetVisible
For Each myCell In ListRng.Cells
.Copy _
after:=Worksheets(Worksheets.Count)
Set NewWks = ActiveSheet
NewWks.Name = myCell.Value
Next myCell
.Visible = xlSheetHidden
End With
End Sub


Sunnyskies wrote:

All the sheets are on one file.
The names of the other sheets are created by using a macro refering to a list.
This is the macro to create the other sheets and give them a name according
to the list.

Sub NameSheets()
'will add a sheet, and name it
'for each name in column A
'from B7 down till it hits a blank row

Dim Rng As Range
Dim ListRng As Range
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
With Worksheets
.Add(After:=.Item(.Count)).Name = Rng.Text
End With
End If
Next Rng
End Sub

And then I want to copy a template and paste into each of the sheets created.

I hope this will provide some guideance.

"Martin Fishlock" wrote:

Afternoon Sunnyskies:

You will have to give a little more information.

Where are the other sheets?
How do you know the names?
Are they in the same workbook?

Generally you do this:

activesheet.cells.copy worksheets("Sheet1").cells

to copy and paste

but if you know the names you can paste all at once as in

ActiveSheet.Cells.Copy
Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet7", "Sheet9")).Select
Sheets("Sheet2").Activate
Cells.Select
ActiveSheet.Paste


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

Afternoon,

I have a template sheet that I want to copy to many other sheets using a
macro. The other sheets all have unique sheet names.

Thanks

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

  #17   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Copy Sheet to many sheets at once

You would use it in place of the line that does the copying of the worksheet.

Sunnyskies wrote:

Morning Dave,

I thought that broading my cry for help would provide more possible solutions.

I see that on http"//mcse.ms/message2392323.html you corrected a command line
MyWorkbook.Sheets.Add Type:="c:\path\templatefilename.xlt"

Where would I put this line on my macro?

Thanks

"Dave Peterson" wrote:

And I see you've started another thread elsewhere.

I'll bow out.

Dave Peterson wrote:

I use xl2003 with windows XP (home), too.

I don't have a guess why it doesn't work for you.

Maybe it's time to split your data into smaller pieces and run it multiple
times?

Sunnyskies wrote:

Microsoft Office Proffesional Edition 2003

"Dave Peterson" wrote:

I don't think that emailing the workbook to me would help you.

What version of Excel are you using?

Sunnyskies wrote:

Morning Dave,

Use windows XP, how many times did you try.

Possible to e-mail to you?

Thanks

"Dave Peterson" wrote:

I tried it with 134 names and it worked fine.

What version of excel are you using?



Sunnyskies wrote:

Afternoon Dave,

I changed the sheet9999 to Parameters as this is where the list of names is,
then ran the macro, which went well, until it hit sheet number 44, then it
popped up the same error message as before : Method 'Copy' of
object_Worksheet' failed.

"Dave Peterson" wrote:

What's the name of the worksheet that contains the list?

I used sheet9999. You'd want to use the correct name.

I also named my template worksheet Template.

You'd want to change this line:
Set TmpWks = Worksheets("Template")



Sunnyskies wrote:

Afternoon Dave,

After copying your macro I hit the following errors.

The command With Worksheet (''sheet9999") tells me out of range. Change to
250 and still does not function. So made it a comment line.
Then made End With also a comment line.
Now battling with the command line
.Copy _
after:=Worksheets(Worksheets.Count)
So altered it a little to .Copy_after:=Worksheets(Worksheet.Count)
Now I get the same run time error as Martins 1004, Method 'Copy' of
object_Worksheet' failed.

Some assistance please.

Thanks

"Dave Peterson" wrote:

Maybe just copying the template (a worksheet in the same workbook???) would be
sufficient:

Option Explicit
Sub testme01()
Dim TmpWks As Worksheet
Dim NewWks As Worksheet
Dim myCell As Range
Dim ListRng As Range

With Worksheets("sheet9999")
Set ListRng = .Range("B7", Range("B7").End(xlDown))
End With
Set TmpWks = Worksheets("Template")

With TmpWks
.Visible = xlSheetVisible
For Each myCell In ListRng.Cells
.Copy _
after:=Worksheets(Worksheets.Count)
Set NewWks = ActiveSheet
NewWks.Name = myCell.Value
Next myCell
.Visible = xlSheetHidden
End With
End Sub


Sunnyskies wrote:

All the sheets are on one file.
The names of the other sheets are created by using a macro refering to a list.
This is the macro to create the other sheets and give them a name according
to the list.

Sub NameSheets()
'will add a sheet, and name it
'for each name in column A
'from B7 down till it hits a blank row

Dim Rng As Range
Dim ListRng As Range
Set ListRng = Range(Range("B7"), Range("B7").End(xlDown))
For Each Rng In ListRng
If Rng.Text < "" Then
With Worksheets
.Add(After:=.Item(.Count)).Name = Rng.Text
End With
End If
Next Rng
End Sub

And then I want to copy a template and paste into each of the sheets created.

I hope this will provide some guideance.

"Martin Fishlock" wrote:

Afternoon Sunnyskies:

You will have to give a little more information.

Where are the other sheets?
How do you know the names?
Are they in the same workbook?

Generally you do this:

activesheet.cells.copy worksheets("Sheet1").cells

to copy and paste

but if you know the names you can paste all at once as in

ActiveSheet.Cells.Copy
Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet7", "Sheet9")).Select
Sheets("Sheet2").Activate
Cells.Select
ActiveSheet.Paste


--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Sunnyskies" wrote:

Afternoon,

I have a template sheet that I want to copy to many other sheets using a
macro. The other sheets all have unique sheet names.

Thanks

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

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
Loop Macro a variable number of times thesaxonuk Excel Discussion (Misc queries) 11 October 31st 06 06:05 PM
how do i copy various sheets date to one sheet in the same excel . Dinesh Excel Worksheet Functions 0 September 15th 06 02:06 PM
Selecting Last Sheet Bonbon Excel Worksheet Functions 17 February 22nd 06 04:16 PM
Does excel recognise names rather than cells? Sue Excel Worksheet Functions 9 May 22nd 05 04:51 AM
linking multiple sheets to a summary sheet greg g Excel Discussion (Misc queries) 1 December 16th 04 07:43 AM


All times are GMT +1. The time now is 04:03 PM.

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

About Us

"It's about Microsoft Excel"