LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default How to duplicate Worksheets

Hello Newsgroup,

I have created some template worksheets in my Excel VBA projekt and
want to duplicate them. How can I do that without errors?

1. Try: Simply use method copy.
I got this error if I execute this code some times:
Worksheets("Template1").Copy(, Worksheets(Worksheets.count))
'Error: 1004: "Copy Method of Worksheet Class failed"
I have found this help page from MS:
http://support.microsoft.com/default...b;en-us;210684
But I'm not using named ranges.

2. I have tried to create a new worksheet and place the a range from
the template on it:
Set NewSheet = Worksheets.Add
Worksheets(sTemplateSheet).Range("A1:V127").Copy NewSheet
But If execute this code in a loop to create all new tables, Excel
crashes down.

3. I have create a new Workbook with all template sheets an have copied
the templates also in my main sheet. The same error as in 1. appears.



What can I do to create sheets by template? I there a hint?

 
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
Deleting Duplicate Data in Two Worksheets Sharon Excel Discussion (Misc queries) 1 May 21st 08 08:52 PM
Duplicate worksheets Clute Excel Discussion (Misc queries) 1 November 14th 07 06:35 PM
Duplicate Worksheets XLS:1 and XLS:2 Howeecow Excel Discussion (Misc queries) 3 June 4th 07 08:38 PM
Duplicate Worksheets mlofton Excel Discussion (Misc queries) 1 September 7th 05 02:58 PM
checking for duplicate worksheets Rick B[_6_] Excel Programming 1 January 22nd 04 06:25 PM


All times are GMT +1. The time now is 03:55 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"