Can I select and delete multiple objects from a worksheet?

S

Stewart

I am working in a very large spreadsheet and there are many text boxes and
arrows/line objects on the worksheet. I want to remove all of these wihtout
having to select each individual text box, arrow and line. Is it possible to
select all objects on a worksheet and delete them?
 
J

Jim Cone

Yes it is...
Edit | Goto | Special (button) | Objects
--
Jim Cone
Portland, Oregon USA




"Stewart" <[email protected]>
wrote in message
I am working in a very large spreadsheet and there are many text boxes and
arrows/line objects on the worksheet. I want to remove all of these wihtout
having to select each individual text box, arrow and line. Is it possible to
select all objects on a worksheet and delete them?
 
C

CurlyDave

Yes it is...
Edit | Goto | Special (button) | Objects
--
Jim Cone
Portland, Oregon  USA

"Stewart" <[email protected]>
wrote in message
I am working in a very large spreadsheet and there are many text boxes and
arrows/line objects on the worksheet.  I want to remove all of these wihtout
having to select each individual text box, arrow and line.  Is it possible to
select all objects on a worksheet and delete them?

use can use a code that will delete all the shapes


Sub Button5_Click()
Dim Sh As Shape
With Worksheets("Sheet1")
For Each Sh In .Shapes
Sh.Delete
Next Sh
End With
End Sub

This next code will delete shapes from a specific range, modified code
found at his site
http://www.mvps.org/dmcritchie/excel/shapes.htm


Sub ClearShapes()
Dim r As Range
Dim myshape As Shape

Set r = Range(Worksheets("Sheet1").Range("B6"), Worksheets
("Sheet1").Range("L17"))

Application.ScreenUpdating = False

r.Select

For Each myshape In ActiveSheet.Shapes

If Intersect(myshape.TopLeftCell, _
Selection) Is Nothing Then
'do nothing
Else
myshape.Delete
End If

Next myshape

Range("B6").Select

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top