Paste Special - Paste Values only not working!

Max10240

New Member
Joined
Feb 3, 2018
Messages
2
Hey everyone, I'm pretty new to this so sorry if this is a rookie question. I have a pretty hefty spreadsheet at work that I'm wanting to do some enhancements to, so I'm working on it at home with a mockup of the same format (false data and not such intricate formatting is the only real change.)

Basically, we have data that we take from Sheet 2 (different numbers of rows each time hence the Current Region selection) and paste to the first blank row of Sheet 1, always starting in Column A. As of now, I have the data cutting/pasting to from Sheet 2 (A1) to the first blank row of Sheet 1, however I can't seem to get the Paste Values only function to work! I've read multiple threads on this, copied/pasted exactly what they have, as well as tried just manually entering the Paste Values only from the VBA Help in Excel, but I keep getting an error message. Can anyone help?

This is the code that works correctly for cut/paste (no attempt at paste special):

Sub MoveCurrentRegion()
Sheets("Sheet2").Range("A1").CurrentRegion.Cut Destination:= _
Sheets("Sheet1").Range("A1").End(xlDown).Offset(1, 0)
End Sub

This is what I've written so far for the attempt at cutting/pasting values only:

Sub PasteSpecialCurrentRegion()
Sheets("Sheet2").Range("A1").CurrentRegion.Cut
Sheets("Sheet1").Range("A1").End(xlDown).Offset(1, 0).PasteSpecial xlPasteValue
End Sub

The error message I'm getting is "Run-time error '1004': PasteSpecial method of Range class failed. Can anyone help me with the right way to write this?
 

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.
Use .Copy instead of .Cut to put the data in the clipboard.

The xlPasteValues argument ends with an s.

Try something like this to clear the values after .Copy\PasteSpecial

Code:
[COLOR=darkblue]Sub[/COLOR] PasteSpecialCurrentRegion()
    [COLOR=darkblue]With[/COLOR] Sheets("Sheet2").Range("A1").CurrentRegion
        .Copy
        Sheets("Sheet1").Range("A1").End(xlDown).Offset(1, 0).PasteSpecial xlPasteValues
        .ClearContents
    [COLOR=darkblue]End[/COLOR] [COLOR=darkblue]With[/COLOR]
[COLOR=darkblue]End[/COLOR] [COLOR=darkblue]Sub[/COLOR]
 
Last edited:
Upvote 0
Ah! Thank you so much! I knew there was something silly andsmall I had to be missing. It just wasn’t adding up. :) That code worked perfectly!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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