What combination of statements do I want to use...

Glory

Well-known Member
Joined
Mar 16, 2011
Messages
640
What combination of statements do I want to use to indicate that I want to be able to see the "Sub" procedure I'm creating in the Macro menu (the one revealed with alt+F8) when the project that contains the module is active, but not when it's not?

I tried Option Private Module but that just makes the subs vanish completely, even when they're explicitly declared as public subs wt the procedure level.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Yeah, it even disables accelerators when you use "Option Private Module". I just want to not be drowned in loads of extraneous subs. Can I do that with a VBA module-level declaration statement, or is there some setting I can tweak somewhere that will work for me?
 
Upvote 0
In a normal module, just declare a Private Sub.

It has implications if you want to call that Sub outside of the module but in that case you can do something like

Application.Run "MyPrivateSub"

Wouldn't really recommend doing this though.
 
Upvote 0
What wouldn't you recommend doing? Making the module private?

Making the module private doesn't allow me to see the macro in the F8 macro menu when the project is the active window. That's what I'm looking for.
 
Upvote 0

Forum statistics

Threads
1,214,670
Messages
6,120,830
Members
448,990
Latest member
rohitsomani

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