Hi,
I want to delete multiple images from the worksheet using macro. I tried different codes but none of them are giving the desired result. Either they delete all the objects including combobox and buttons or they don't do anything (couldn't find msoPicture).
Macro which I tried:
Sub DeletePictures()
Dim shp As Shape
For Each shp In ActiveSheet.ShapeRange
If shp.Type = msoPicture Then
shp.Delete
End If
Next shp
End Sub
Sub DeleteImage()
Dim Pic As Object
For Each Pic In ActiveSheet.Pictures
Pic.Delete
Next Pic
End Sub
Any help would be appreciated.
I want to delete multiple images from the worksheet using macro. I tried different codes but none of them are giving the desired result. Either they delete all the objects including combobox and buttons or they don't do anything (couldn't find msoPicture).
Macro which I tried:
Sub DeletePictures()
Dim shp As Shape
For Each shp In ActiveSheet.ShapeRange
If shp.Type = msoPicture Then
shp.Delete
End If
Next shp
End Sub
Sub DeleteImage()
Dim Pic As Object
For Each Pic In ActiveSheet.Pictures
Pic.Delete
Next Pic
End Sub
Any help would be appreciated.