Calling Private Sub from User Form

R

Rob

Hi,

I have a User Form which when displayed runs a Sub in a module, I want to
set this Sub to Private so that it doesn't show in the Run Macro window.
However, setting to Private causes the Sub to be hidden from the USer Form
and thus, the code fails. Is there a way to set the Sub to Private and
still have it run by code in a User Form.

Thanks in advance for any suggestions. Rob
 
B

Brian

I had the same problem a week ago. Put this at the top of your Module. The
sub can be call from the UserForm Code Window, but it will not be seen under
Macros.

Option Private Module

Let me know if this helps
 
R

Rob

Brian,

Solution worked a treat, Thank you. Rob

Brian said:
I had the same problem a week ago. Put this at the top of your Module. The
sub can be call from the UserForm Code Window, but it will not be seen
under
Macros.

Option Private Module

Let me know if this helps
 

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