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


Canceling a Menu

Want to back out of whatever you are doing in a menu? As with many tasks, Word provides several different ways you can ...

Discover More

Changing Elements in Lots of Charts at One Time

Got a bunch of charts that you need to make formatting changes in? You can use a macro (or two) to apply the formatting ...

Discover More

Taking a Picture

Excel allows you to capture portions of your worksheet as a picture that you can then use in a variety of other ways. ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

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

Unlocking a Worksheet with an Unknown Password

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

Locking a Worksheet Automatically

The protection features built into Excel can help you to make sure that only things are changeable that you want changed. ...

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 9 + 5?

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.