Program Question for Dave peterson

B

Brian

I have a User Form that is in a workbook by itself. This User Form controls
and updates 3 other workbooks.

Workbooks are as folllows:
User Form
Spec
Forms
Label

I had all my code in the Main User Form code window, but several of the Subs
got to big to run and it got to confusing to try and find what went where. At
that point I moved the code from the Main User Form code window to individual
Modules. Each module has only the code for that type of Sub for each of the 3
workbooks. Then in the Main User Form code window I use the following code to
call the Subs.

'*******************************************************
'Update_Update_Installer_Forms_10 Control Button
'*******************************************************
Private Sub Update_Installer_Forms_10_Click()
'Located in M4_Update_Workbook
Call Update_Installer_Forms1
'Located in M4_Update_Workbook
End Sub

List of Modules:
M1_Battery_String
M2_Open_New_Workbook
M3_Open_Existing_Workbook
M4_Update_Workbook
M5_Update_Hidden_Data
M6_Update_from_Data_Sheet
M7_Emergency_Data_Load
M8_Update_Header_Footnote
M9_Save_Workbook

Would it better to cahnge this structure to only 3 modules and only put what
code goes with that workbook in each of the modules?

My problem is that all the subs in the modules a public and show up as
Macros in excel. How can I make them private so they are not visible like a
macro?

If I change it to 3 Modules
M1_Spec
M2_Forms
M3_Label

Can I use this code at the top of the module to call the subs and make them
all private?

Private Sub Update_Installer_Forms_10_Click()
Call Update_Installer_Forms1
End Sub

Thanks for you input
 
D

Dave Peterson

First, it's probably not a good thing to ask for help from any one person. Lots
of people will ignore your message and you may find that you're not getting as
much help as you wanted.

You can hide all the subs from appearing in the alt-f8 menu by using something
like this at the top of your module:

Option Private Module

Or you can make sure each sub you want to hide has an argument, like:

Public Sub Update_Installer_Forms1(optional dummyArg as variant)
....
 

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