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.
 

Some videos you may like

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Glory

Well-known Member
Joined
Mar 16, 2011
Messages
640
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?
 

ScottR

Well-known Member
Joined
Apr 17, 2008
Messages
545
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.
 

Glory

Well-known Member
Joined
Mar 16, 2011
Messages
640
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,530
Messages
5,602,190
Members
414,513
Latest member
junbuggle

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
Top