I want to call a private sub that is "in" a sheet (because it is intimately associated with events on the sheet) from a general module without exposing the private sub to Tools -> Macro -> Macro drop-down.
Can it be done? If so, how?
Thanks.
****
I want to call a private sub that is "in" a sheet (because it is intimately associated with events on the sheet) from a general module without exposing the private sub to Tools -> Macro -> Macro drop-down.
Can it be done? If so, how?
Thanks.
****
Hello Dpenny,
Private is a keyword that controls the scope of a procedure. All other procedures on the same worksheet can call each other whether they are public or private. Only public sub and functions are accessible outside of the worksheet they were created on.
The only procedures that are excluded from the MacroDropdown List are procedures that require arguments. My assumption about the logic behind this is if a macro is assigned to a button control how could you pass needed arguments once the macro was run. So, the only way I can see is have your Sub take a dummy argument and declare it as Optional.
Sincerely,![]()
Please Login or Register to view this content.
Leith Ross
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks