dpaton05
Well-known Member
- Joined
- Aug 14, 2018
- Messages
- 2,375
- Office Version
- 365
- 2016
- Platform
- Windows
I have this code to delete some images on my spreadsheet, but there are now 2 images I don't want the code to delete. The names of them are Image1 and Image2.
How can I change it so that it won't delete those images?
Thanks,
Dave
How can I change it so that it won't delete those images?
Code:
Private Sub cmdNoSig_Click()
ActiveSheet.Unprotect Password:="npssadmin"
Dim Pic As Object
For Each Pic In ActiveSheet.Pictures
If Not Intersect(Pic.TopLeftCell, Range("A12:A300")) Is Nothing Then
Pic.Delete
End If
Next Pic
'ActiveSheet.Protect Password:="npssadmin"
End Sub
Thanks,
Dave