Rename Modules Using Macro

Jaye7

Well-known Member
Joined
Jul 7, 2010
Messages
1,069
Is this a script that I can use to rename a module in my workbook.

i.e. I want to use a script to change

code:
private sub module1

to

code:
sub module1

And then when I am finished using it I would then change it back to private sub.

I don't want all the scripts in the macros dropdown list yet if I set them to private sub then they will not work.

Thanks
 
Hi

I'd avoid changing code with code.

I don't want all the scripts in the macros dropdown list yet if I set them to private sub then they will not work.


If that's your problem, there are other alternatives, for ex.: declare the Subs that have no parameters (the only ones that appear in the macros list) as Functions, and they will not appear in the macros dropdown list.
 
Last edited:
Upvote 0
Use:
Code:
Option Private Module
at the top of the module whose subs you do not want to appear in the macros dialog.
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top