View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Calling a Private Sub

One way:

Use "Option Private Module" at the top of the module.

Note that you can still run the macro if you type the name in the macro
box, but you have to know the name, and you can do that with Private
macros, too.



In article ,
ben wrote:

This is probably someting painfully simple. But I have a workbook full of
macros, that I don't want the user to be able to access directly through the
macros dialog box. I know I can keep them out of there by using Private Sub
declaration, but I want to be able to call them from other procedures within
the VBA code. Is there a way to call a Private Sub, or is there a way to make
a sub inaccesible directly to the user but otherwise allowing VBA code to
access it?