|
Home > Structure > Worksheets > Objects Excel Worksheet ObjectsHow to add objects, such as shapes and images, to a worksheet. If you copy data from a website, objects might also be copied. See how to list the objects on a sheet, or select and delete them. Tip: To fix the Excel error, Cannot Shift Objects Off Sheet, go to the Excel Shift Object Error page. |

If you copy data from a website, and paste it into Excel, a few objects from the website might also be copied to your Excel sheet. In the screen shot below, there is a "Top of Page" icon -- one of several that was copied along with the data.
This tutorial explains how to find the objects, select them, and quickly delete them.

Watch this video to see how to show a list of objects, and select and delete the objects. Written instructions are below the video, along with the full video transcript.
If you'd like to read the video transcript, click on the green check box below. When you're finished, you can click the check box again, to hide the transcript
If you copy data from a website into Excel, you might end up with some little images that you don't want.
Perhaps there are some buttons from the website, or little icons that you would click on that site, to go to the top of the page.
So we'll see how to get rid of those images very quickly in Excel.
So here's a page on the Microsoft website -- there's a list of keyboard shortcuts
We can see all the details that copied over very nicely
But we can see here, a little icon that was copied from the web page
There are probably others. If I scroll down, I might see a few more. So there's another one.
To see a full list of the objects that have been copied,
And I can see all the pictures
So there are four pictures that were copied from the website onto this page
If I click on one of these, it would select that object
So if I click here, picture 6, I can see that this object has been selected
Then I could just use the Delete key on my keyboard to get rid of that one
Now if there are lots of images, and you want to get rid of them all, it would take quite a while to go through, and select each one from this list, and delete it
So, I'm going to hide the list. I'll just click this X to close it.
To select all of the objects, if I want to get rid of all of them:
When I click OK, that object is selected, and if I scroll back up to the top, I can see this one
So everything is selected now, and I'll just have to press the Delete key on my keyboard
That gets rid of them all
And just to verify, I'll go back to Find & Select
Open the selection pane, and there aren't any more objects on the worksheet
For more Excel tips and tutorials, please visit my Contexture website at www.contextures.com
To see a list of the objects that are on the active worksheet, you can open the Selection Pane:

The Excel Selection pane opens, and usually it is docked at the right side of the Excel window.
To change the Selection pane's size or position, follow these steps:
In the Selection pane, you can see a list of all the shapes (objects) on the current worksheet.
To select a shape, or multiple shapes, follow these steps:

To quickly select all the objects on a worksheet, you can use the Go To Special command.


After you select all the objects on a worksheet, or select a single object, you can delete it.

Here are two macros that will delete all of the shapes on an Excel worksheet.
These macros can save you time, but use them with caution -- read the warning below!
This macro deletes all shapes on the active sheet only. It does not affect any other sheets in the workbook.
Warning: Be sure to make a backup copy of your Excel file before running this macro.
Sub DeleteShapesSheet()
'deletes all shapes on active sheet only
Dim iSh As Long
With ActiveSheet
For iSh = .Shapes.Count To 1 Step -1
.Shapes(iSh).Delete
Next
End With
End Sub
This macro deletes all shapes, on ALL sheets in the workbook.
Warning: Be sure to make a backup copy of your Excel file before running this macro.
Sub DeleteShapesAllSheets()
Dim ws As Worksheet
Dim iSh As Long
For Each ws In ActiveWorkbook.Worksheets
For iSh = ws.Shapes.Count To 1 Step -1
ws.Shapes(iSh).Delete
Next
Next ws
MsgBox "Done"
End Sub
Instead of using boring grey buttons, you can use colourful shapes to run macros on a worksheet.
For example, you can insert a rounded rectangle on a worksheet, then colour it to match your workbook's colour scheme.

After you click, that shape will appear on the worksheet, in its default size.
In the screen shot below, the shape's name is Rounded Rectangle 1

To make the shape look more like a button, instead of a flat rectangle, you can add a Shape Style:



If you plan to make several shapes in the workbook, and want them all to have a Shape effect, such as Bevel, you can change one of the Theme settings.
In the screen shot below, I clicked on the the Office 2007-2010 option.

After you apply a Theme Effect, go back and look at the Style Gallery.
In the bottom row, the shapes should show the effect that you applied.
For example, in the screen shot below, the buttons have a bevelled effect, like the styles had in older versions of Excel.

To make it clear what the button does, add some text. In this example, the button will run a macro that toggles the column headings, from numbers, to letters, or letters to numbers.
To add text to the button, follow these steps:
Next, follow these steps to format the button text:

To make the macro run a macro that has been stored in the workbook:


NOTE: To select a shape after a macro has been assigned, right-click on the shape. 🔼
In Microsoft Excel, if you try to hide or insert worksheet rows or columns, or if you try to apply a filter, you might see this Excel error: Cannot Shift Objects Off Sheet. Or, in some versions of Excel, you'll see this error: Can't push objects off the sheet.
A simple shortcut -- Ctrl + 6 -- fixed this problem for me, and there are more suggestions on the Excel Shift Object Error page.
This short video shows the Excel error, Cannot Shift Objects Off Sheet, and how you can try to fix the problem.
Don't miss my monthly Excel newsletter! You'll get quick tips, article links, and a bit of fun. Add your email, and click Sign Up.
Next, when you get my reply, click the Confirm button. I add this step to protect you from spam!
Don't miss my monthly Excel newsletter! You'll get quick tips, article links, and a bit of fun. Add your email, and click Sign Up.
Next, when you get my reply, click the Confirm button. I add this step to protect you from spam!
FAQs - Excel Application and Files
Last updated: October 2, 2024 11:12 AM