Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Excel sheet copy problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
thulasidhar@gmail.com - 24 Jan 2006 20:52 GMT
Hi,
Iam trying to copy a sheet using VBA, but in vain,

The code is very simple as below,

Sheets("Sheet1).Copy After:=Sheets(Sheets.Count)

But the execution bombs out without any error notification.
When i try to debug and step thru, after this line gets executed,
the execution comes out without any indication of error.
Further statements are not executed and the copy operation does not
take place.

Is something wrong with the way iam trying to copy a sheet?

I need to copy the sheet as the sheet contains some form objects(like
buttons)
and i found that it was quite a hassle to add a new sheet, move the
text, create form objects on the new sheet and most importantly add the
handling code for the forms.
I thought i would create a sheet as a template in the same workbook and
copy and create a new sheet as and when required. But a simple thing
(or i think so) as this is not working.

Can someone help me out?

Using Excel 2002

regards
thulasi
Jim Thomlinson - 24 Jan 2006 20:59 GMT
Teh line should be highlighted in red in the VB editor because you are
missing the second ". The line should read

Sheets("Sheet1").Copy After:=Sheets(Sheets.Count)
not
Sheets("Sheet1).Copy After:=Sheets(Sheets.Count)
Signature

HTH...

Jim Thomlinson

> Hi,
> Iam trying to copy a sheet using VBA, but in vain,
[quoted text clipped - 26 lines]
> regards
> thulasi
thulasidhar@gmail.com - 25 Jan 2006 03:32 GMT
Sorry, Typo while posting here.
Actual code is like what u have specified
   Sheets("Sheet1").Copy After:=Sheets(Sheets.Count)
and the problem occurs.

Any ideas?
Jim Thomlinson - 25 Jan 2006 17:00 GMT
Depending what you are up to you may be running into a known issue...

http://support.microsoft.com/default.aspx?scid=kb;en-us;210684

Signature

HTH...

Jim Thomlinson

> Sorry, Typo while posting here.
> Actual code is like what u have specified
>     Sheets("Sheet1").Copy After:=Sheets(Sheets.Count)
> and the problem occurs.
>
> Any ideas?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.