Problem with PasteSpecial

Zanahorio

New Member
Joined
Jun 19, 2013
Messages
2
Hi there!
Can anyone help me with such a simply looking issue,please?
I use a sheet with some design, including fields for input by user.
To prevent destroying my design, I would like to let users input datas only as a paste without formatting the cell.
So I typed in this VBA code:
Selection.PasteSpecial Paste:=xlPasteValues

But it gives me an error message
"Error 1004
Application defined or object defined error"

any ideas how to make it ?
thanks
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi there,

Could you post a bit more of the code please or possibly some detail about what you are trying to paste?

Thanks
 
Upvote 0
Hi there,

Could you post a bit more of the code please or possibly some detail about what you are trying to paste?

Thanks

Hello!
there is no special code for it yet. It's just about the action "Paste different".
I mean, I would like to copy a cell or more cells from an excell sheet with some measured data.
And then to paste them in a different excell file with my predefined look and with my code included that will count something.
The problem is that if you copy-paste something, it acts just as normal "Paste" and destroyes my layout(colours, font face, whatever)
So to prevent this, it would be nice to include a function automaticly using function Paste as differenet, which will insert just plain data.
Many thanks
Martin
 
Upvote 0
there is nothing wrong with that line of code, but it needs to have more than that in the macro to actually work !!
 
Upvote 0
If I am reading this correctly I think you are trying to change the Excel default Paste to be Paste Special Value. I am not sure if such a thing is possible; I have certainly never heard of it. Sorry.
 
Upvote 0
Sorry David, but Paste Special is one of the Standard commands of Excel
 
Upvote 0
Hi Michael

Thanks for that. Yes, paste special is a standard but I think Zanahorio is try to set Paste | Special | Value to be the default paste option as opposed to Paste | All. Or I might be misunderstanding the post. Either way, I can't help.

Regards
Dave
 
Upvote 0
Yep, I understand your confusion....There isn't really much to go on !!
Maybe if we get some more info from the OP, it will become clearer....:pray:
 
Upvote 0

Forum statistics

Threads
1,213,526
Messages
6,114,136
Members
448,551
Latest member
Sienna de Souza

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