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: Get Rid of Web Stuff.
Written by Allen Wyatt (last updated February 27, 2021)
This tip applies to Excel 97, 2000, 2002, and 2003
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.
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 (2881) 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: Get Rid of Web Stuff.
Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!
Make a reference to a hyperlink in a formula, and you may be surprised that the reference doesn't return an active ...
Discover MoreIs your worksheet information destined for a Web page? Here's how you can specify the fonts that should be used when ...
Discover MoreWhen you create a worksheet that is destined for viewing on the Web, you will want to specify the monitor resolution you ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2024-02-29 20:08:39
Mike
That was beautiful thank you!!!!
-Mike
2021-02-27 06:14:28
BARRY
You could also use a Web Query from within Excel and set the parameters to only copy the text.
This is particularly useful if you get content from the same web page and are copying it into the same location in the worksheet as all the parameters are remembered by Excel includng the website URL so all that needs to be done is to Refresh the the query. I use this a lot to get stock values from financial websites.
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.
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