Hello, I am very new to this and to VBA writing. Up to this point I have been recording macros and then searching for code to change what I recorded to do what I want it to do. I tell you this to let you know, I know very little but am enjoying the learning process.
I got an insert image macro from this site that allows me to choose an image and insert it by hitting the button. What I need is a macro that will undo the insert. I recorded a macro and then altered it but it ends up deleting the button once it has deleted the image.
Here is the code:
Sub Undo()
'
' Undo Macro
' Macro recorded 05/06/2010 by Dr. Daniel T. Cole
'
ActiveSheet.Unprotect
ActiveSheet.Shapes(ActiveSheet.Shapes.Count).Select Undo
Selection.Delete
ActiveSheet.Protect
'
End Sub
Any help?
I got an insert image macro from this site that allows me to choose an image and insert it by hitting the button. What I need is a macro that will undo the insert. I recorded a macro and then altered it but it ends up deleting the button once it has deleted the image.
Here is the code:
Sub Undo()
'
' Undo Macro
' Macro recorded 05/06/2010 by Dr. Daniel T. Cole
'
ActiveSheet.Unprotect
ActiveSheet.Shapes(ActiveSheet.Shapes.Count).Select Undo
Selection.Delete
ActiveSheet.Protect
'
End Sub
Any help?