Hello, I had no idea how to write a good title for this problem.
I have a workbook with many different sheets with different macros needed in each sheet.
Sometimes a sheet is used as a template - VeryHidden and copied when needed.
Not knowing any better I put my code specific to each sheet in: VBAProject\Microsoft Excel Objects\Sheet...\"View Code" and it worked.
Now I would like a macro from one sheet to call a procedure in another sheet.
Which is easy if that procedure is "Public":
But then that procedure is Public which I do not want (User can try to run it directly from Excel.![]()
Call Worksheets("Sheet1").testProcedure
I found that I should use "Option Private Module" which works in "VBAProject\Modules".
But in Excel objects I get a compile error "Option Private Module not permitted in an object module". And I am stuck.
I have two problems:
1. Can it work the way I want it to (a Public procedure in object module not seen by the user)
2. Is my concept of organizing macros, code is wrong? Are there any tips/tutorials telling how to do it?
Bookmarks