Copy method of Worksheet class failed

G

Guest

Hello I Have the following code:

Worksheets("Data History").Copy after:=Worksheets("Adviser")

and if produces this error:

Run-time error '1004':

Copy method of Worksheet class failed

Both Sheets referenced in the code exist in the workbook. Any Ideas why this
is happening. It only started recently. The code worked before.

Regards and thanks for all help.

Francis.
 
G

Guest

Hello.
I solved my own problem.
entered line:
Worksheets("Data History").Activate
before the offending line and code now works.

? Why does it need this as the Worksheet is referenced explicitly.

Regards

Francis.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top