How do I prevent certain macros from showing in the macro list box? Please, help!

J

Juchelka

Hello guys, I have another one...

I have several public subs in VB project module. Some of these are
called from various events on the sheets/workbook and subsequently they
show in the macro dialog box list (from user's point of view). Is there
a way to prevent these subs to show in the macro list?

Thank you!

Alex J.
 
J

JE McGimpsey

Juchelka said:
Hello guys, I have another one...

I have several public subs in VB project module. Some of these are
called from various events on the sheets/workbook and subsequently they
show in the macro dialog box list (from user's point of view). Is there
a way to prevent these subs to show in the macro list?

Add the line

Option Private Module

to the top of the module in which your subs are stored.

Note that a user can still run the macro by typing in the name of the
procedure.
 
J

Juchelka

Wonderful! Thank you JE!

I am protecting the vb project (only for user's own good, of
course...), so guessing the procedure's name would be problably
difficult... This is just a precaution and a shorcut, really, since I
don't know of any cleaner way in Excel...

AJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top