Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default really weird copy macro problem


This is weird. Alright heres the situation:
I have a macro that copy's a default template sheet however many times
a person wants. Now the code for this is

Private Sub CommandButton2_Click()
Unload Me
numofbids = numofbids.Value
firstbid = afterbid.Value + 9
after = afterbid.Value
For i = 1 To numofbids
Sheets("dontdelete").Copy after:=Sheets(firstbid)
numberofbids = Application.Sheets.Count - 10
varone = numberofbids
vartwo = numberofbids + 9
till = numberofbids - after

For d = 1 To till
Sheets(vartwo).Name = varone
Sheets(vartwo).Range("U1").Value = varone
varone = varone - 1
vartwo = vartwo - 1
Next d


Sheets(firstbid + 1).Select
firstbid = firstbid + 1
after = after + 1
Next i

End Sub

Now the problem is that when I open the file and I run the macro to
copy the sheet 25 times. it stops at 23 sheets and tells me: Copy
method of worksheet class failed run time error '1004'. Does anyone
know why this happens. O and also I delete the extra files and try it
again and for some reason it wont even copy one time. whats going
on


--
gillrajb
------------------------------------------------------------------------
gillrajb's Profile: http://www.excelforum.com/member.php...o&userid=34610
View this thread: http://www.excelforum.com/showthread...hreadid=548969

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
Weird Excel 2003 macro problem LindaB789 Excel Discussion (Misc queries) 2 July 30th 09 08:40 PM
Weird problem Sue Excel Worksheet Functions 2 November 29th 05 12:10 PM
Weird Macro Problem Bruce001 Excel Programming 6 August 26th 05 03:20 AM
Weird macro mistakes or goof ups - copy of original post André Excel Programming 0 July 9th 04 02:14 PM
Weird VBA problem Bob[_55_] Excel Programming 3 May 12th 04 11:39 PM


All times are GMT +1. The time now is 07:23 AM.

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"