script for deleting images

  • Thread starter Thread starter Gor_yee
  • Start date Start date
G

Gor_yee

Hi all, I've got an excel spreadsheet that has 10 sheets on it, is
there a script that I can run to delete only the "pictures" on the
sheet??I've also got text on the spreadsheet but i dont want that
deleted. Can you help out?
 
Hello

Sub DeletePics()
dim i As Long
Dim sh As Shape
For i = 1 To Sheets.Count
For Each sh In Worksheets(i).Shapes
If sh.Type = msoPicture Then sh.Delete
Next sh
Next i
End Sub

HTH
Cordially
Pascal
 
Hello

Sub DeletePics()
dim i As Long
Dim sh As Shape
For i = 1 To Sheets.Count
For Each sh In Worksheets(i).Shapes
If sh.Type = msoPicture Then sh.Delete
Hey....just tried it...its fantastic...many thanks...
 
Back
Top