Trying to copy a value from 1 worksheet to another

I have the following sub routine that is trying to copy a data cell from one worksheet to another…

Sub Copy_Data()
Dim DataString As String

  Application.ScreenUpdating = False
  DataString = Worksheets("Data").Range("E2:E2").Value

  Worksheets("DRA Summary").Range("F5:F5").Select
  Application.ScreenUpdating = True

End Sub

When the statement below is executed…

This error occurs…
Run-time error '1004':
Select method of Range class failed.

I am trying to copy the data in cell E2 from the worksheet named “Data” to
Cell F5 in the worksheet named “DRA Summary”

Can anyone help with this or suggest a better way of accomplishing this data copy?

Who is Participating?
mvidasConnect With a Mentor Commented:
Hi Tesla,

You can avoid the select issue by simply applying the .Copy to the actual range object rather than the selection range object:
  Worksheets("DRA Summary").Range("F5").Paste

Open in new window

Another option to do that is to use the Destination argument of the .copy method:
Worksheets("Data").Range("E2").Copy Destination:=Worksheets("DRA Summary").Range("F5")

Open in new window

You could also just move the inner value from one cell to the other:
Worksheets("DRA Summary").Range("F5").Value = Worksheets("Data").Range("E2").Value

Open in new window

Many ways to do similar things :)
tesla764Author Commented:
Thanks Matt. That works great. I am taking this assignment one elementry step at a time. Very good so far. On to the next step.
Thanks for your help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.