Copy method of Worksheet class failed

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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.
 
Back
Top