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


Understanding the For ... Next Structure

Spend any time creating Word macros, and sooner or later you will need to repeat some of your programming code a certain ...

Discover More

Displaying a Hidden First Row

If you hide the first rows of a worksheet, you may have a hard time getting those rows visible again. Here's a simple way ...

Discover More

Specifying Different Weekends with NETWORKDAYS

The NETWORKDAYS worksheet function can be used to easily determine the number of work days (Monday through Friday) within ...

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)

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

Limiting Input by Time of Day

Excel provides some great tools that allow you to limit what is entered into a worksheet. This tip looks at how those ...

Discover More

Protecting Many Worksheets

Need to protect a lot of worksheets? Rather than protect the sheets individually, you'll appreciate the macros discussed ...

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}] 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 3 - 0?

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.