Delete macro automatic

A

Ad Stam

Is it possible to delete single macro's within a module.
I'v already found Application.OrganizerDelete, but this
wil delete an entire module.
 
J

Jezebel

It's a fairly complex object model, but you can get to -- and manipulate --
the code in a module with a reference like

application.VBE.VBProjects(1).VBComponents(1).CodeModule

where VBProjects and VBComponents correspond to the elements in the VBE
project window. You don't delete the macro as such -- rather you select the
lines of code in the module that contain the macro, and delete those lines.
Read help for the details.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top