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

Entering Numbers in Excel

Enter information into a cell, and Excel needs to figure out what type of information it is. Here's how Excel interprets ...

Discover More

Subtotals Option Grayed Out

The Subtotals option on the Data menu is normally available for adding or removing subtotals to data tables. If the ...

Discover More

Changing the Size of Start Screen Tiles

The Start screen can serve as your launching pad for whatever programs you use on your system. If your Start screen ...

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

Limiting Number of Characters in a Cell

Need to limit the number of characters that can be entered into a cell? One easy way to do it is through the use of Data ...

Discover More

Shortcut for Selecting a Data Range

Want to select all the data in a contiguous section of a worksheet? The shortcut discussed in this tip makes it very easy.

Discover More

Getting Rid of Everything Except Numbers

Got some numbers and letters mixed up in the same cell? You may need to get rid of those letters so you are left with ...

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