0
votes

I am running a VBA macro that involves multiple copy-paste processes. However, using .copy (destination) give a "Copy method of Range class failed." Here's that code.

Dim Prop As Range
Dim propo As Range
Set Prop = sha.Range("B6")
Set propo = Sheets("Summary").Range("B1")
Prop.Copy (propo)

However, I have found an odd work-around to this issue. Instead of .copy (destination) I use .copy and then .PasteSpecial:

Dim Prop As Range
Dim propo As Range
Set Prop = sha.Range("B6")
Set propo = Sheets("Summary").Range("B1")
Prop.Copy
propo.PasteSpecial (xlPasteValues)

Any idea why this was necessary? I would prefer to keep it simple going forward.

1
remove the () around propoScott Craner
Thanks Scott! I'm surprised it was that simpleTollbooth

1 Answers

3
votes

It appears that the reason this was necessary was that your syntax was incorrect. In the Microsoft doc for Range.Copy it lists that to add a destination, your code should be:

Worksheets("Sheet1").Range("A1:D4").Copy _ 
    destination:=Worksheets("Sheet2").Range("E5")

As shown here: https://msdn.microsoft.com/en-us/library/office/ff837760.aspx