Easy way to select all HTML Objects for deletion in MS Excel

2

2

So, here's the situation:

  • I copy some data from a website into MS Excel.
  • I look at the data in MS Excel and see checkboxes.
  • When I select 'Design Mode' to delete the checkboxes, I see hidden textboxes.

I would like to select all the HTML or 'other' objects on the spreadsheet and delete them. Is there an easier way to do this than select one, hold down CTRL, and select the next one (repeat)?

I'm using MS Excel 2003.

Thanks! JFV

JFV

Posted 2009-09-02T13:25:29.823

Reputation: 1 017

Answers

4

You can use Goto>Special>Objects to select all objects in the active sheet, then delete them in one go. This will remove all non-form HTML elements if data has been pasted in from a web page.

To wipe out any pasted form controls as well would need a bit of VBA to delete in one go:

Sub DeleteObjects()
    Dim obj As Object
    For Each obj In ActiveSheet.Shapes
        obj.Delete
    Next
End Sub

Lunatik

Posted 2009-09-02T13:25:29.823

Reputation: 4 973

Rockin! That's an awesome tip! I was able to clear all the HTML Objects without breaking a sweat! Thanks! – JFV – 2009-09-03T15:06:15.833