I have an Excel workbook with VBA code that makes several copies of one of the sheets. Every time I run the macro, I get the following error:
Run-time error '1004':
Copy method of Worksheet class failed
The error always occurs when there are 58 sheets in the workbook and the macro is attempting to create the 59th. My code is as follows:
For i = 1 To {variable} Step 1
Sheets({sheetname}).Copy After:=Sheets(Sheets.Count)
Next i
I am running Excel 2000 and VB 6.0 in Win 2000.
Any help will be greatly appreciated!
Run-time error '1004':
Copy method of Worksheet class failed
The error always occurs when there are 58 sheets in the workbook and the macro is attempting to create the 59th. My code is as follows:
For i = 1 To {variable} Step 1
Sheets({sheetname}).Copy After:=Sheets(Sheets.Count)
Next i
I am running Excel 2000 and VB 6.0 in Win 2000.
Any help will be greatly appreciated!