Code: Select all
Private Sub CommandButton2_Click()
Dim shp As Shape
Dim MyRange As Range
Set MyRange = Range("C4")
For Each shp In ActiveSheet.Shapes
If shp.Top = MyRange.Top And shp.Left = MyRange.Left Then
shp.Delete
Exit For
End If
Next shp
End Sub
Code: Select all
ActiveSheet.Unprotect
' Code to manipulate pictures here
...
ActiveSheet.Protect