Please Note: This article is written for users of the following Microsoft Excel versions: 2007 and 2010. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Shifting Objects Off a Sheet.

Shifting Objects Off a Sheet

by Allen Wyatt
(last updated July 13, 2015)

8

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

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (809) applies to Microsoft Excel 2007 and 2010. You can find a version of this tip for the older menu interface of Excel 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

Embedding an Excel Worksheet

Word and Excel are both integral parts of Microsoft's Office suite of applications. As such, Word allows you to embed ...

Discover More

Searching for Leading Apostrophes

Take a look at the Formula bar when you select a cell that contains text, and you may see an apostrophe at the beginning of ...

Discover More

Catching Single-Letter Spelling Errors

There have been times when I've reviewed my writing and found lots of "lone letters," detached by a single space from the ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

MORE EXCELTIPS (RIBBON)

Disabling Moving Between Worksheets

If you want someone to not be able to move from one worksheet to another in a workbook, you've got your work cut out for you. ...

Discover More

Finding a Worksheet with a Specific Value in a Specific Cell

If you have a lot of worksheets in workbook, finding the exact one you want can be a bit tricky. This tip looks at various ...

Discover More

Creating Worksheets from a List of Names

Need to create a large number of worksheets using specific names? If so, you'll love the ideas presented in this tip.

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 for this tip:

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. 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 seven minus 6?

2016-07-18 12:35:13

Joshua

Found so many other sites that offered the same useless solution.

This post was great, and it worked!

Wish I saw this one first.


2016-07-03 18:37:05

Robert Armstrong

All the other posts I found on the internet we totally useless, but this worked straight off, so thank you very much for this.


2015-06-09 20:49:25

Lauren Raymundo

I had the same problem and NOTHING helped me. I could type or copy/paste into the blank columns on the right of my spreadsheet, but could not insert a column. I removed the data filtering and VOILA, it worked.


2015-02-11 08:57:35

ruban

It is not working in my sheet, Please guide me.


2014-09-19 11:42:20

Jan

I'm using 2010 version and I just started getting this when trying to insert row. My spreadsheet has 808 lines of data. I cannot insert even 1 line - HELP!!


2014-07-15 11:21:19

dbjbdbj

COMMENTS
I had the same problem trying to delete all rows below the useful data. Turns out that the COMMENTS I had on some cells in the top row had somehow been made VERY TALL. In fact, when I would enter "Edit Comment" and check the "Format Comment" window, I found that the "Height" was BLANK. When I made the comments short enough such that they fit within the useful data (and not overlap into the rows I was trying to delete), the ERROR STOPPED!


2013-10-08 06:36:09

Youssef Amarir

Hello,

I'm really grateful for this useful tip. It worked immediately!

Youssef


2013-01-16 13:43:35

gerdami

That's amazing. I got this error message today...

However, I won't use .xlMoveAndSize because I hate this resizing feature. I will simply use .xlMove (Move but don't size with cells )


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.

Links and Sharing
Share