Forum

Macros to Paste Val...
 
Notifications
Clear all

Macros to Paste Values from Clipboard

2 Posts
2 Users
0 Reactions
222 Views
(@rkbuckley)
Posts: 1
New Member
Topic starter
 

I would like to create a macro that allows me to paste values of something copied from one range to another.

The macro should paste from the clipboard any copied range from any source (another sheet or workbook) and should paste those values into (starting at) a user-selected range.

I thought this code (below) would work, but Error msg 1004 indicates that the Paste Special method of Range has failed. What can I do to make this work?

Sub PasteValue()
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End Sub

 
Posted : 13/01/2022 6:36 pm
(@catalinb)
Posts: 1937
Member Admin
 

You have to copy first. You get the error because there was no copy action before pasting.

 
Posted : 15/01/2022 2:29 am
Share: