Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to delete Macro
I want to create a macro X that will delete another macro Y - assume macro X
is stored in the Personal Macro Workbook & macro Y is stored in the currently active workbook. What is the code to delete a macro? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to delete Macro
Have a look at Chip Pearson's website:
http://www.cpearson.com/excel/vbe.htm RBS "Lynn" wrote in message ... I want to create a macro X that will delete another macro Y - assume macro X is stored in the Personal Macro Workbook & macro Y is stored in the currently active workbook. What is the code to delete a macro? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to delete Macro
Here is some code that deletes myProc from Module1
Sub DeleteProcedure() Const vbext_pk_Proc = 0 Dim oCodeModule As Object Dim iStart As Long Dim cLines As Long Set oCodeModule = ThisWorkbook.VBProject.VBComponents("Module1").Cod eModule With oCodeModule iStart = .ProcStartLine("myProc", 0) cLines = .ProcCountLines("myProc", 0) .DeleteLines iStart, cLines End With End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Lynn" wrote in message ... I want to create a macro X that will delete another macro Y - assume macro X is stored in the Personal Macro Workbook & macro Y is stored in the currently active workbook. What is the code to delete a macro? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro warning - how to delete macro | Excel Worksheet Functions | |||
delete a macro that isn't in macro list | Excel Discussion (Misc queries) | |||
How can I delete a macro when the Delete button is not active? | Excel Worksheet Functions | |||
How do i delete a macro in Excel 2003 when delete isn't highlight | Excel Discussion (Misc queries) | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming |