-
Solved: Remove a macro after execution?
If this post already exists I apologize, as I could not find anything similar.
Is there a way to either :
- Clear vba code after macro execution
- remove macro altogether after execution
?????
I though I have seen, or read this before, but cannot find the source. Thanks!
-
I don't believe you can run a macro which requires its own removal. How would you reach End Sub? You could add some other code to the workbook to remove all code except itself, for which I believe there may be examples in the KB
Regards
MD
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
-
Modify this to suit your problem http://www.vbaexpress.com/kb/getarticle.php?kb_id=511 (removes itself (module) after execution of code)
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.
-
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
-
-
Awsome, thanks guys. (solved)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules