Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Help Can not Copy Sheet but Can add a New Sheet!!!


I have a question Currently I have built a database and there is a user
entry form which basically allows people to add users to the database

this worksheet basically is a template and after thee user clicks save the
worksheet actually copies itself and renames itself based on Cell "A1" and
the orginal page is erased back to its beginning state of the template



Here is the code and where I get the Error

-Code worked fine for about first 60 user additions

-Now I get an run time error "1004" copy method or worksheet method
failed

- tried deleting a few users and trying code again worked fine

- also tried to insert a blank sheet which worked fine only promblem is when
i try to copy this sheet template when I have over lets say 60 Worksheets
in Workbook





Sheets("Add KOL Form").Select
Sheets("Add KOL Form").Copy after:=Sheets(Sheets.Count)

Sheets("Add KOL Form (2)").Select
Sheets("Add KOL Form (2)").name = Range("b4")

Range("b2:b2").Select
Selection.ClearContents



Call ButtonUpdate
Sheets("Add KOL Form").Select
Range("b4:b30").Select

Selection.ClearContents
Range("d14:30").Select
Selection.ClearContents


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Help Can not Copy Sheet but Can add a New Sheet!!!


Maybe...
"Copying Worksheet Programmatically Causes Run-Time Error 1004 in Excel"
http://support.microsoft.com/default...b;en-us;210684

And some useful advice...
http://www.cpearson.com/excel/newposte.htm
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Clarence Jackson"

wrote in message
I have a question Currently I have built a database and there is a user
entry form which basically allows people to add users to the database

this worksheet basically is a template and after thee user clicks save the
worksheet actually copies itself and renames itself based on Cell "A1" and
the orginal page is erased back to its beginning state of the template

Here is the code and where I get the Error

-Code worked fine for about first 60 user additions

-Now I get an run time error "1004" copy method or worksheet method
failed

- tried deleting a few users and trying code again worked fine

- also tried to insert a blank sheet which worked fine only promblem is when
i try to copy this sheet template when I have over lets say 60 Worksheets
in Workbook
Sheets("Add KOL Form").Select
Sheets("Add KOL Form").Copy after:=Sheets(Sheets.Count)

Sheets("Add KOL Form (2)").Select
Sheets("Add KOL Form (2)").name = Range("b4")

Range("b2:b2").Select
Selection.ClearContents
Call ButtonUpdate
Sheets("Add KOL Form").Select
Range("b4:b30").Select

Selection.ClearContents
Range("d14:30").Select
Selection.ClearContents
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
copy rows from one Data sheet to another sheet based on cell conte John McKeon Excel Discussion (Misc queries) 2 May 15th 10 06:49 AM
Auto Copy/autofill Text from sheet to sheet if meets criteria Joyce Excel Discussion (Misc queries) 0 November 20th 08 11:05 PM
Search for rows in one sheet and copy into another sheet based on customer id [email protected] Excel Worksheet Functions 1 October 22nd 07 03:09 AM
how to find and copy values on sheet 2, based on a list on sheet 1 evanmacnz Excel Programming 4 February 7th 05 08:33 PM
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. RonMc5 Excel Discussion (Misc queries) 9 February 3rd 05 12:51 AM


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