Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Preventing Someone from Recreating a Protected Worksheet.
by Allen Wyatt
(last updated July 14, 2018)
Jack creates worksheets that he forwards to others in his group so they can input information, and then return the worksheet to him. He protects the worksheets, but has gotten burned a few times by users who have used copy and paste to recreate the worksheet in its entirety. Checking everything to make sure the returned worksheets are the originals is very time consuming, so Jack is looking for a way to remove the ability to copy and paste the worksheets.
Disabling copying and pasting is theoretically easy enough to do. All you need to do is use a short macro, like the following, in the ThisWorkbook object:
Private Sub Worksheet_Deactivate() If ActiveSheet.ProtectContents = True Then Application.CutCopyMode = False End If End Sub
Using this macro essentially clears the Clipboard every time someone deactivates the worksheet by selecting another worksheet or another application.
Of course, this offers only the most rudimentary of protection. A determined user can still copy the worksheet by using the mouse to right-click on the sheet name and then click Move or Copy, or they could disable macros when starting the workbook, and thereby disable your Clipboard-clearing routine.
Perhaps a better way is to look at how business is done in the organization. If you don't want people to copy the worksheet, tell them up front, and make sure they know that you won't accept any duplicates. There are very easy ways to check to see if what you get back is a duplicate. Here are a few of them:
Another thing to try is to set the cell protection property to Hidden before password protecting your worksheet. Users can see the results of what is in the cells, but they cannot see the formulas. If they copy and paste the contents elsewhere, the formulas won't be transferred, only the results. This is very easy to spot in the returned workbook.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12653) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Preventing Someone from Recreating a Protected Worksheet.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
When you first create a worksheet, all the cells in that worksheet are formatted as locked. As you unlock various cells ...Discover More
It is not unusual, in a corporate world, to be handed a worksheet whose source you don't know. If that worksheet is ...Discover More
Need to know if a worksheet or workbook is currently protected? Excel provides some tell-tale signs, but here are some ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.