Stopping a Worksheet from being Moved or Copied

by Allen Wyatt
(last updated November 28, 2020)

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


Scope of Word Options

There are dozens and dozens of settings you can make in Word. Some of them affect only the current document, while others ...

Discover More

Noting When a Workbook was Changed

Do you need to know when a workbook was last changed? There are a couple of ways you can go about keeping track of the ...

Discover More

Determining If a Number is Odd or Even

If you need to know whether a particular value is odd or even, you can use this simple formula. Designed to be used in a ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (ribbon)

Using a Protected Worksheet

If you have a worksheet protected, it may not be immediately evident that it really is protected. This tip explains some ...

Discover More

Visually Showing a Protection Status

Need to know if a worksheet or workbook is currently protected? Excel provides some tell-tale signs, but here are some ...

Discover More

Hiding and Protecting Columns

Want to hide certain columns within a worksheet so the contents are not visible to others? The answer lies in formatting ...

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 2 + 4?

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.