ElCidCampead
01-23-2017, 04:06 AM
Hello,
my purpose is to create a sort of "Undo" button which delete a specific shape, in particular the last one I created.
My idea is to use this code:
Dim sh As Shape
For Each sh In ActiveSheet.Shapes
sh.Delete
Next sh
where instead of deleting all shapes I would delete only the last one I added.
If I find out the time of creation of the last shape, may I delete the shape added in a time range (in this case, now -> now -10 seconds, for example)?
Is there a command that show me the time of creation of shape and has shape as object a property which define the time of its creation? If yes, I could add an if cycle inside the for cycle in order to filter all the shapes added in the last 10 seconds and delete them.
Thanks
my purpose is to create a sort of "Undo" button which delete a specific shape, in particular the last one I created.
My idea is to use this code:
Dim sh As Shape
For Each sh In ActiveSheet.Shapes
sh.Delete
Next sh
where instead of deleting all shapes I would delete only the last one I added.
If I find out the time of creation of the last shape, may I delete the shape added in a time range (in this case, now -> now -10 seconds, for example)?
Is there a command that show me the time of creation of shape and has shape as object a property which define the time of its creation? If yes, I could add an if cycle inside the for cycle in order to filter all the shapes added in the last 10 seconds and delete them.
Thanks