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

Using Overtype Mode

Have you ever typed something in Excel, only to have it replace whatever is to the right of the insertion point? That's known ...

Discover More

Printing a Chart Across Multiple Pages

Wouldn't it be great to have your huge charts print out on multiple pieces of paper that you could then piece together? While ...

Discover More

Getting Rid of "Comment" in Comments

When you add a comment to a document, Word presents that comment in a very specific way. If you want to change the way in ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (ribbon)

Extracting URLs from Hyperlinks

When you add a hyperlink to a worksheet, it consists of a minimum of two parts: display text and URL address. If you have a ...

Discover More

Retrieving Web Query Data without Interruption

If you use Excel's Web Query tools to grab data from a website, you may run into some problems if the site isn't available ...

Discover More

Sending an E-mail when a Due Date is Reached

Wouldn't it be great if Excel could automatically e-mail you when a due date is reached? It can, if you are using Outlook and ...

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 8Mpixels. 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 6 - 4?

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.