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
 

Some videos you may like

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

DavidPe

New Member
Joined
Jun 10, 2013
Messages
27
Hi there,

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

Thanks
 

Zanahorio

New Member
Joined
Jun 19, 2013
Messages
2
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
 

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
19,766
Office Version
  1. 2016
  2. 2013
  3. 2007
Platform
  1. Windows
there is nothing wrong with that line of code, but it needs to have more than that in the macro to actually work !!
 

DavidPe

New Member
Joined
Jun 10, 2013
Messages
27

ADVERTISEMENT

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.
 

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
19,766
Office Version
  1. 2016
  2. 2013
  3. 2007
Platform
  1. Windows
Sorry David, but Paste Special is one of the Standard commands of Excel
 

DavidPe

New Member
Joined
Jun 10, 2013
Messages
27
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
 

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
19,766
Office Version
  1. 2016
  2. 2013
  3. 2007
Platform
  1. Windows
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:
 

Watch MrExcel Video

Forum statistics

Threads
1,123,176
Messages
5,600,140
Members
414,365
Latest member
UUR

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
Top