View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Paul B[_6_] Paul B[_6_] is offline
external usenet poster
 
Posts: 135
Default Delete Macro After Running

Bill, here is one way from a previous post
If you only want to use the macro one time then
Place your macro in a module called Module1 together with the macro
deletemodule and run the sub deletemodule.
The whole Module will be deleted, remember that.

Sub deletemodule()
Yourmacro
With ThisWorkbook.VBProject.VBComponents
..Remove .Item("Module1")
End With
End Sub

Sub Yourmacro()
MsgBox "Hi"
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"Bill Oertell" wrote in message
...
Is there any way to delete a macro after it has run successfully?