Sub () that does NOT appear in Macro selection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to have a Sub () not appear in the macro selection (alt f9) ?
 
Private Sub yourMacroNmae()


If a sub has a parameter then it won't appear.

private sub yourMacroName(dummy as object)

Just pass in a 0

Peter
 
I just noticed that Private subs from other modules can't be called. Is there
a way around this?
 
Hi J@y, private subs are normally used for ThisWorkbook, Worksheet and
Control Event code such as Workbook_Open, Wordsheet_Activate and
UserForm_Click. They are not intended to work except for that specific
environment. If the designer wants code to be public and able to be called
from anywhere in the project, then the code needs to be written in the
general modules which are named Module 1, 2, etc. and do not precede the word
sub with the word private.
 

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

Back
Top