View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Delete Modules in Macro

Mark,

Here is an example for Module2

Dim VBComp As Object

Set VBComp = ThisWorkbook.VBProject.vbcomponents("Module2")
ThisWorkbook.VBProject.vbcomponents.Remove VBComp

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mark" wrote in message
...
The macro recorder does not record the mouse clicks to Delete a Module.

How can I delete modules via a macro?

Thanks,
Mark