Always paste special

yoko

Active Member
Joined
Sep 5, 2006
Messages
349
Hi,

I have a sheet which is protected but people are still able to change cell formats etc if they use the standard paste method. I want people to be able to paste data in but it forces paste special values to stop people pasting formats etc over already formatted and locked cells.

I know I could write a macro and run it using the shortcut keys ctrl-v but then the users lose the ability to undo if they make a mistake.

Is there a way to force paste special or allow users to run a macro but be able to do undo if they make a mistake?

Cheers,
 
Alternatly, you could write a routine that formats the workbook the way that you want it and then have the Change event call that routine.

Then after each Copy/Paste, the formatting would be restored to the way you want it.
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Alternatly, you could write a routine that formats the workbook the way that you want it and then have the Change event call that routine.

Then after each Copy/Paste, the formatting would be restored to the way you want it.

Thanks, mikerickson! That is an interesting approach. However, some of the data that needs to be pasted is a set of digits (account numbers) that may have leading zeros.

When pasting digits with leading zeros from certain applications, Excel converts it to a number and strips the leading 0s. That is a bad thing and converting it back to a text entry doesn't restore those leading 0s. Because the set of digits can be of varying lengths, we don't know how long any particular set of digits was originally, so we can't restore the leading zeros.
 
Upvote 0
Yes - The cut Button on the ribbon bar is still active. I agree - this code needs tobe updated to disable that ribbon. I will look into this.
 
Upvote 0
I believe this code is longer than it needs to be.
The 'undo' code is unnecessary because an undo can be done when a paste special... is done under normal circumstances.

It also creates a problem when you have locked cells in your workbook
 
Upvote 0

Forum statistics

Threads
1,215,008
Messages
6,122,672
Members
449,091
Latest member
peppernaut

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