Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.
With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company.
Learn more about Allen...
Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Preventing Someone from Recreating a Protected Worksheet.
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 Edit | Move or Copy Sheet, 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 (3322) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) 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!