Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Private Sub - Called from Userform

I am trying to make all my subs private to minimize confusion for
others using my excel spreadsheet.

All of my subs/macro are on Module1, including a public sub called
ItemDataInput.

On my Userform code, if the user presses a certain button it calls sub
ItemDataInput.

The problem though is if I make Sub ItemDataInput "Private", it
doesn't work.

Any way to work around this? Or do I have to just have a visible/
public sub? (This isn't the end of the world, could just have it be
public, but figured to ask :))

Thankx, NP
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,420
Default Private Sub - Called from Userform

Keep the subs public, and add the statement

Option Private Module

to the start of Module1. This will make all procedures in Module1 public to
that project, but not to others, and they will not show in the macro list.

--
__________________________________
HTH

Bob

"pallaver" wrote in message
...
I am trying to make all my subs private to minimize confusion for
others using my excel spreadsheet.

All of my subs/macro are on Module1, including a public sub called
ItemDataInput.

On my Userform code, if the user presses a certain button it calls sub
ItemDataInput.

The problem though is if I make Sub ItemDataInput "Private", it
doesn't work.

Any way to work around this? Or do I have to just have a visible/
public sub? (This isn't the end of the world, could just have it be
public, but figured to ask :))

Thankx, NP



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Private Sub - Called from Userform

Excellent. Works like a charm. Now all those confusing sub routines
are all hidden gems for the weary to work their way through if they so
choose to, hehe.

Thanks for the tip, I was wondering what the point of the "Option
Explicit" was whenever you opened up a module using record macro.

On 7$B7n(B14$BF|(B, $B8a8e(B4:35, "Bob Phillips" wrote:
Keep the subs public, and add the statement

Option Private Module

to the start of Module1. This will make all procedures in Module1 public to
that project, but not to others, and they will not show in the macro list.

--
__________________________________
HTH

Bob

"pallaver" wrote in message

...



I am trying to make all my subs private to minimize confusion for
others using my excel spreadsheet.


All of my subs/macro are on Module1, including a public sub called
ItemDataInput.


On my Userform code, if the user presses a certain button it calls sub
ItemDataInput.


The problem though is if I make Sub ItemDataInput "Private", it
doesn't work.


Any way to work around this? Or do I have to just have a visible/
public sub? (This isn't the end of the world, could just have it be
public, but figured to ask :))


Thankx, NP- $B0zMQ%F%-%9%H$rI=<($7$J$$(B -


- $B0zMQ%F%-%9%H$rI=<((B -


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,420
Default Private Sub - Called from Userform

I missed the relevance of your response.

--
__________________________________
HTH

Bob

"pallaver" wrote in message
...
I am trying to make all my subs private to minimize confusion for
others using my excel spreadsheet.

All of my subs/macro are on Module1, including a public sub called
ItemDataInput.

On my Userform code, if the user presses a certain button it calls sub
ItemDataInput.

The problem though is if I make Sub ItemDataInput "Private", it
doesn't work.

Any way to work around this? Or do I have to just have a visible/
public sub? (This isn't the end of the world, could just have it be
public, but figured to ask :))

Thankx, NP



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Private Sub Workbook_Open() doesn't run Steve Starr Excel Discussion (Misc queries) 4 April 3rd 11 05:05 AM
Private sub problem sby Excel Worksheet Functions 1 November 28th 07 04:50 PM
Private Sub CommandButton1_Click() Bob Excel Discussion (Misc queries) 2 December 2nd 06 02:14 AM
Common Private Sub Booker Excel Discussion (Misc queries) 1 November 15th 05 08:50 AM
Private sub Mark New Users to Excel 3 April 6th 05 03:36 PM


All times are GMT +1. The time now is 12:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"