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: Shifting Objects Off a Sheet.

Shifting Objects Off a Sheet

Written by Allen Wyatt (last updated April 8, 2021)
This tip applies to Excel 97, 2000, 2002, and 2003


Mudit ran into problems when trying to delete rows and columns in a worksheet. He sometimes gets the message "Cannot shift object off this sheet." Other people report getting the message when they try to insert rows or column.

What is happening is that an object—such as a graph, drawing object, text box, picture, or even comment—cannot be correctly handled by Excel after the deletion or insertion. If the error occurs when inserting rows or columns, it means that the insertion would push the object beyond the right or bottom boundaries of the worksheet. The solution, of course, is to check whatever is at the right or bottom of the worksheet and make changes to those objects (move or delete them) as necessary.

If the error occurs while deleting rows or columns, it is normally because there are objects attached to cells within those rows or columns, and deleting the rows or columns would leave the objects "orphaned" in some way. For instance, let's say you are deleting column D, and there is an object associated with cell D4. The object doesn't need to be situated over column D; it could be several columns away, but still belong to cell D4. If you delete column D, then the object no longer has an anchor point. Excel's solution? Don't let column D be deleted until you do something with the object that would be orphaned by the edit.

The problem can also occur if the objects in a worksheet are formatted so that they cannot be moved or sized automatically by Excel, and then you try to delete columns or rows associated with the objects. In this case, you may want to try changing the formatting of the objects in the worksheet. If you have a lot of such objects in the worksheet, the following macro can be helpful in making the change:

Sub ResetShapes()
    Dim s As Shape
    On Error Resume Next
    For Each s In ActiveSheet.Shapes
        s.Placement = xlMoveAndSize
    Next
End Sub

Microsoft provides a Knowledge Base article that can be helpful with this problem. The article specifically addresses the issue of hiding rows and columns, but the solutions work when you are trying to delete them, as well. You can check it out at this page:

http://support.microsoft.com/kb/211769

If you are using Excel 97, you should reference this page, instead:

http://support.microsoft.com/kb/170081

Note:

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 (3151) 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: Shifting Objects Off a Sheet.

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

MORE FROM ALLEN

Locking a Field

When you use fields in your document, you may want them to not change from a particular displayed result. You can lock ...

Discover More

Controlling Chart Gridlines

Gridlines are often added to charts to help improve the readability of the chart itself. Here's how you can control ...

Discover More

Improper Index References

When indexing a document, you may get some funny results once in a while. If you get single index entries when you were ...

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 (menu)

Concatenating Ranges of Cells

Putting the contents of two cells together is easy. Putting together the contents of lots of cells is more involved, as ...

Discover More

A Fast Find-Next

Tired of the Find and Replace dialog box blocking the view of your worksheet when you are searching for information? Do ...

Discover More

Selecting the Current Region

Most of Excel's commands affect whatever cells you select prior to invoking the command. Some commands, however, affect ...

Discover More
Subscribe

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

View most recent newsletter.

Comments

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 four less than 7?

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

Newest Tips
Subscribe

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.