Delete all pictures in a selected range of cells Excel VBA

The following program Deletes all pictures in a selected range of cells Excel VBA.


Sub DeletePics()
Dim PicRng As Range
Dim Pic As Picture
Dim Rng As Range
Application.ScreenUpdating = False
Set Rng = Range("B1:B100")
For Each Pic In ActiveSheet.Pictures
Set PicRng = Range(Pic.TopLeftCell.Address) ' & ":" & Pic.BottomRightCell.Address)
If Not Intersect(Rng, PicRng) Is Nothing Then Pic.Delete
Next
Application.ScreenUpdating = True
End Sub

https://www.extendoffice.com/documents/excel/5145-excel-vba-delete-pictures-in-range.html

https://stackoverflow.com/questions/4480231/deleting-pictures-with-excel-vba

 

You must be logged in to post a comment.