ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copy method problem (https://www.excelbanter.com/excel-programming/402227-copy-method-problem.html)

beezak

copy method problem
 
I've strange problem with copy method in Excel 2003.



Sub Macro1()

Sheets("sht1").Select
Sheets("sht1").Copy After:=Sheets(3)



End Sub



When I run this code, it stop on copy method and unexpectedly break
application. Of course macro didn't duplicate "sht1".



Can anyone give me some help?




Dave Peterson

copy method problem
 
Is there anything interesting with Sht1? Does it exist? Is it hidden?

Do you have at least 3 sheets in that workbook?

If those don't help, what does the error message say?

beezak wrote:

I've strange problem with copy method in Excel 2003.

Sub Macro1()

Sheets("sht1").Select
Sheets("sht1").Copy After:=Sheets(3)

End Sub

When I run this code, it stop on copy method and unexpectedly break
application. Of course macro didn't duplicate "sht1".

Can anyone give me some help?


--

Dave Peterson


All times are GMT +1. The time now is 06:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com