PasteSpecial method of Range class failed

Excelnewbie001

Board Regular
Joined
Jan 25, 2017
Messages
79
I used the macro recorder on a protected sheet to copy and paste and I am getting the following error if someone can please tell me how to get rid of it please....thanks for any help

Code:
Wb.Sheets("Test1").Range("F5:H5").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Test").Select
    Sheets("Test").Unprotect "Test12"
    Range("J2").Select
   [COLOR=#ff0000] Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
        xlNone, SkipBlanks:=False, Transpose:=False[/COLOR]
    Sheets("Test").Select
    Range("D2").Select
 
Last edited:

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Assuming that you are trying to paste onto sheet Test try this mod
Code:
    [COLOR=#0000ff]Sheets("Test")[/COLOR].Range("J2").Select
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,262
Members
452,627
Latest member
KitkatToby

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top