Hey
I'm trying to make a command button that removes itself from the sheet after it's been pushed.
I've tried the following code, but can't seem to make it work.
Sub deleteshapesinrange()
Dim rng As Range
ActiveSheet.Shapes(Application.Caller).TopLeftCell.Offset(1, 1).Activate
Set rng = Range(ActiveCell, ActiveCell)
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
If Not Intersect(shp.TopLeftCell, rng) Is Nothing Then shp.Delete
Next shp
End Sub
The code above selects the cell to the bottem right of the command button and I'm not experienced enough to fix the problem.
The real problem actually is that the range needs to be dynamic.
It would be nice if anyone could help me.
Bookmarks