ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how can i delete a macro (https://www.excelbanter.com/excel-programming/275537-how-can-i-delete-macro.html)

mcm

how can i delete a macro
 
I'm currently working on a worksheet which was suppose to not have
macros in it. When I checked whatever macros there were in that
worksheet I noticed that there was one. I tried to delete it but the
'Delete' button is not activated. When I tried to run the macro, excel
returned an error message telling me that the link to this macro cannot
be found or somethin' like that. How can i clean up that macro list in
excel?

Tom Ogilvy

how can i delete a macro
 
Go into the VBE (alt+F11), look at the project explore (Ctrl+R), if you have
an entry Modules under your workbook, then expand that and right click on
each module and select Remove. You can decline to prompt to export it.

double click on each entry for sheet
click in the resulting module, do Ctrl + a, then delete key, click the X in
the upper right corner of the module.

do this for the ThisWorkbook entry as well.

Now go back to excel and save the workbook.

--
Regards,
Tom Ogilvy


"mcm" wrote in message
...
I'm currently working on a worksheet which was suppose to not have
macros in it. When I checked whatever macros there were in that
worksheet I noticed that there was one. I tried to delete it but the
'Delete' button is not activated. When I tried to run the macro, excel
returned an error message telling me that the link to this macro cannot
be found or somethin' like that. How can i clean up that macro list in
excel?




mcm

how can i delete a macro
 
Hi Tom

While I was able to delete all macros in the workbook,
there is still one 'macro' that can't seem to be deleted.
There are no more modules present in the worksheet but
when I pop up the Tools - Macro - Macros window, there
is still one macro remaining but I can't delete or remove
it from the list. When i click 'Run' I get an error
window that says 'Reference is not valid'.

Would appreciate some more advise on this.

Thanks

mcm


-----Original Message-----
Go into the VBE (alt+F11), look at the project explore

(Ctrl+R), if you have
an entry Modules under your workbook, then expand that

and right click on
each module and select Remove. You can decline to prompt

to export it.

double click on each entry for sheet
click in the resulting module, do Ctrl + a, then delete

key, click the X in
the upper right corner of the module.

do this for the ThisWorkbook entry as well.

Now go back to excel and save the workbook.

--
Regards,
Tom Ogilvy



Tom Ogilvy

how can i delete a macro
 
A vba macro can only exist in a module. You might have an Excel 4 type
macro on a macro sheet.

for each sh in activeworkbook.worksheets
sh.Visible = True
Next

Run the above from another workbook. If should make all sheets in the
workbook visible and expose any macro sheets.

either that, or you workbook might be getting corrupted would be my best
guess.

--
Regards,
Tom Ogilvy

"mcm" wrote in message
...
Hi Tom

While I was able to delete all macros in the workbook,
there is still one 'macro' that can't seem to be deleted.
There are no more modules present in the worksheet but
when I pop up the Tools - Macro - Macros window, there
is still one macro remaining but I can't delete or remove
it from the list. When i click 'Run' I get an error
window that says 'Reference is not valid'.

Would appreciate some more advise on this.

Thanks

mcm


-----Original Message-----
Go into the VBE (alt+F11), look at the project explore

(Ctrl+R), if you have
an entry Modules under your workbook, then expand that

and right click on
each module and select Remove. You can decline to prompt

to export it.

double click on each entry for sheet
click in the resulting module, do Ctrl + a, then delete

key, click the X in
the upper right corner of the module.

do this for the ThisWorkbook entry as well.

Now go back to excel and save the workbook.

--
Regards,
Tom Ogilvy





mcm

how can i delete a macro
 
I will try this Tom and keep you posted.


All times are GMT +1. The time now is 05:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com