Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. 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: Get Rid of Web Stuff.
Written by Allen Wyatt (last updated March 9, 2024)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021
Grant regularly copies information from Web pages and pastes that information into worksheets. He ends up not only with raw data, but also with other items, such as checkboxes, pictures, logos, etc. Grant wants an easy way to get rid of all these non-data items.
When you first paste from the Web into an Excel worksheet, you may want to consider using Paste Special to do something like Paste As Text or Paste Values. This should help preclude getting those unwanted objects into your worksheet in the first place.
If Paste Special doesn't give the desired results or if you are working with a worksheet into which the information and objects have already been pasted, there are a few things you can try. The first thing that most people try is to use Go To Special, in this manner:
Figure 1. The Go To Special dialog box.
When you do this, Excel selects a number of the objects in the worksheet, and you can then press the Delete key to get rid of them. The problem is that this method doesn't select all the non-data items in the worksheet; it only selects a subset of them—those items that are considered "objects" by Excel.
A better solution is to use a macro to select all the shapes in the worksheet and then delete them. This is fairly simple to do, using a macro like this one:
Sub DeleteAllShapes1() Dim shp As Shape For Each shp In ActiveSheet.Shapes shp.Delete Next End Sub
The macro just loops thru each shape on the active worksheet and deletes each one. You could expand on the macro just a bit by having it also delete all the hyperlinks that are pasted in the worksheet. All it takes is the addition of a single line:
Sub DeleteAllShapes2() Dim shp As Shape For Each shp In ActiveSheet.Shapes shp.Delete Next ActiveSheet.Hyperlinks.Delete End Sub
If, for some strange reason, these macros don't get rid of all the non-data items you want removed, there is another approach you can use: make a stop in NotePad before Excel. Simply paste your Web data into a blank NotePad document, then select that information (after it is pasted) and copy it back to the Clipboard. Then, paste it into Excel. The only thing that is left should be straight data.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (6951) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Get Rid of Web Stuff.
Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!
Hyperlinks in a worksheet can be helpful or essential, depending on the nature of your data. If you create a link to a ...
Discover MoreWant your worksheets to be available to others on the Internet? Excel provides a way you can save your data in HTML ...
Discover MoreWhen copying information from the Internet to an Excel workbook, you may want to get rid of graphics but keep any ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments