Stopping a Worksheet from being Moved or Copied

Written by Allen Wyatt (last updated July 8, 2024)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365

Matthew notes that a user can rather easily right-click on a worksheet tab and thereby move or copy a worksheet to another workbook. He is looking for a way to prevent this behavior; he needs a way to stop a user from making a copy of a worksheet or moving it.

This is harder than one would, at first, think. The standard approach is to protect the workbook. (Use the Protect Workbook tool on the Review tab of the ribbon.) Provided you protect the structure, Excel will disable the Move or Copy Sheet option.

Perhaps, for some reason, you don't want to protect the workbook. In that case you can create macro solutions that may do the trick for you. For instance, let's say that you have a macro in the code module for the worksheet itself. You could have that macro, as part of its functioning, check for the presence of some other data in the workbook or some system variable. (The data should be external to the worksheet, but still in the workbook.) If the presence is detected, then everything functions as you would want.

If, however, the user copies or moves the worksheet to another workbook, then obviously the other data or variable will not be there. If your macro (which was moved with the worksheet) doesn't detect the required data, then the macro could do whatever action you feel is appropriate, including deleting the worksheet.

A different macro-based approach would be to utilize two events for the worksheet, in this manner:

Private Sub Worksheet_Activate()
    ThisWorkbook.Protect "Hello"
End Sub
Private Sub Worksheet_Deactivate()
    ThisWorkbook.Unprotect "Hello"
End Sub

These two event handlers simply protect the workbook whenever the worksheet is selected and, conversely, unprotect it when a different worksheet is selected. Why do this? For the reason mentioned earlier—protecting the workbook can turn off the ability to move or copy worksheets. Because the user would always need to select the worksheet before copying or moving, the acts are disabled because the event handlers kick into play.

Remember, though, that if your objective is to stop the user from copying the data and/or formulas on the worksheet, you need to think beyond the user possibly copying or moving the worksheet. The user can always copy cell contents from the worksheet to a different worksheet, which might defeat what you are trying to do.


If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13804) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.

Author Bio

Allen Wyatt

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. ...


Understanding Click and Type

The Click and Type feature of Word allows you to use the mouse to click somewhere on a blank page, and then begin typing. ...

Discover More

Refreshing Web Discussions

How to refresh the Discussions screen to ensure all comments are visible.

Discover More

Jumping Around Folders

If you need to move between two different folders quite regularly in the Open dialog box, you'll find the technique ...

Discover More

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!

More ExcelTips (ribbon)

Protecting Worksheets from Deletion

If you share a workbook with others in your office, you will probably want to make sure that some of the worksheets don't ...

Discover More

Preventing Someone from Recreating a Protected Worksheet

When you share a protected workbook with other people, you may not want them to get around the protection by creating a ...

Discover More

Protecting a Worksheet's Format

You can protect various parts of your worksheets by using the tools built into Excel. One thing you can protect is the ...

Discover More

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is nine minus 3?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)

This Site

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.

Newest Tips

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.