Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. 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.

Get Rid of Web Stuff

by Allen Wyatt
(last updated June 1, 2017)

6

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:

  1. Press F5. Excel displays the Go To dialog box.
  2. Click the Special button. Excel displays the Go To Special dialog box.
  3. Select the Objects option.
  4. Click OK.

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.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (6951) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Get Rid of Web Stuff.

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

Formulas Don't Calculate as Formulas

Enter a formula (starting with an equal sign) and you may be surprised if Excel doesn't calculate the formula. Here's a good ...

Discover More

Getting the Proper Type of Ellipses

Type three periods in a row, and the AutoCorrect feature in Word kicks in to exchange that sequence for a special ellipses ...

Discover More

Creating a Double Hanging Indent

A hanging indent is a type of paragraph formatting in which all lines of the paragraph are indented from the left margin with ...

Discover More

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!

More ExcelTips (ribbon)

Sending Single Worksheets via E-mail

Got a single worksheet that you want to e-mail to someone, but don't want them to see the rest of the worksheets in the ...

Discover More

Pasting HTML without Hyperlinks

Excel allows you to copy information from the web and paste it into a worksheet. Problem is, the pasting could take some time ...

Discover More

Converting to Hyperlinks in a Shared Workbook

When you enter a URL or e-mail address in a worksheet, Excel usually converts it to a clickable hyperlink. This doesn't ...

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}] 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 four less than 9?

2013-09-09 09:04:03

Jennifer Thomas

Other paste methods (text only/values only) are great if you really just want the content characters.

But I find that I often want to keep the hyperlink targets and formatting, and remove all the graphic objects, so this tip is perfect for that purpose!


2013-05-14 06:21:41

Barry Fitzpatrick

The above techniques are fine for occasional use. But if this done on a regular basis to fetch information which changes then the Excel "web query" feature is the way to go.

I would recommend putting the query on on its own worksheet then referencing the values in other sheets in the workbook


2013-05-13 15:29:55

Roger Barnes

I have noticed that using regular paste to copy data from a web page can take a bit of time. Instead, I use Paste Special -> Text which specifically does not copy the various objects. Occasionally, when there is table formatting in the web page, I have to use the regular paste to get the data into the correct cells. I then copy the values from one worksheet to another to get rid of the web formatting.


2013-05-13 11:55:28

Dennis Costello

Wouldn't it be easier to Paste-Special Values-Only with the data captured from the Web, and thus avoid creating the extra objects in the first place?


2013-05-12 11:13:06

Dan Miller

I just paste it all into another tab in excel, then copy paste values for the range i want (excluding headers, etc if i don't need them), into the tab where i want the data. Pretty easy step.


2013-05-11 19:08:35

WarwickW

A simpler method is to have a tiny program called PureText in your startup. This program takes almost no resources and places a PT icon in your system tray.

When you copy from the web, just click on this icon before pasting into your document (which can be a spreadsheet or any other document).

The program is available at http://www.stevemiller.net/puretext/


This Site

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.

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.