Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to remove images in worksheet 2

Status
Not open for further replies.

baltog

Programmer
Dec 19, 2002
22
US
Hi All,

I just wanna ask how can i remove the images/pictures in my worksheet. the ff code doest not work.

sheet1.range("A1:F100").clear

it removes only the texts.

thanks in advance

 
Hi!

You either need to know the name of the picture/image, then use

activesheet.shape("my picture").select
selection.delete

or if there are more, and you wan't to delete em'all.

dim sh as shape
for each sh in activesheet.shapes
sh.select
selection.delete
next sh

HTH Roy-Vidar
 
Just a tip:

If you only want to remove pictures and not ActiveX Objects for example use:
Code:
Sub DeletePictures()
Dim pic As Shape
For Each pic In ActiveSheet.Shapes
  If pic.Type = 13 Then 'msoPicture
      pic.Delete
  End If
Next pic
End Sub

I hope this helps!


Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
it seems Mike's tip is much more applicable. thanks a lot guys!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top