View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron de Bruin
 
Posts: n/a
Default VBA, delete all macro

Hi Danny

Copy this macro in Module1
If you run it it delete the whole module

Add code to delete the code in the thisworkbook where it say

'
' your code
'

See Chip's site
http://www.cpearson.com/excel/vbe.htm


Sub TheMacro()
'
' your code
'
With ThisWorkbook.VBProject.VBComponents
.Remove .Item("Module1")
End With
End Sub





--
Regards Ron de Bruin
http://www.rondebruin.nl


"Danny" wrote in message ...
Hi,

I have 3 macros in 1 module and 1 macro (before print) in the
"ThisWorkbook". Is there a way to delete all the macros automatically (with a
macro?!) in a workbook?

Thank you.