![unused excel macro shortcut keys unused excel macro shortcut keys](https://www.timeatlas.com/wp-content/uploads/macro-panel.jpg)
MsgBox "My Macro In Private Module!", vbInformation, "Module 2" Macros in a private module (Option Private Module is on).
#UNUSED EXCEL MACRO SHORTCUT KEYS CODE#
However, at the beginning of the module (Module2 in the sample workbook), there is the “Option Private Module” statement, which automatically makes the code in the entire module invisible. The following macros were explicitly declared as Public ones (note: even if you omit the Public keyword, VBA recognizes by default the macros as public). MsgBox "My Private Macro With Arguments!" & vbNewLine & "Result: " & My_Number_1 * My_Number_2, vbInformation, "Module 1"Įnd Sub Make the entire module Private (Option Private Module) Private Sub My_Private_Macro_With_Arguments(My_Number_1 As Double, My_Number_2 As Double) MsgBox "My Private Macro!!!", vbInformation, "Module 1" Private macros (explicitly defined with the private keyword). The next two subs (Module1 in the sample workbook) were written using the Private keyword. In the next sections, we will see a few examples of macros that were “hidden” using the above suggestions, as well as the corresponding ways to call these macros, despite being invisible from the Macros menu.Įxamples of hidden macros/subs (invisible from the Macros menu)ĭeclare the macro/sub using the Private keyword
![unused excel macro shortcut keys unused excel macro shortcut keys](https://www.excelcampus.com/wp-content/uploads/2018/09/Assign-Keyboard-Shortcut-to-Macro-Open-Options-Window.png)
You just created your super-secret macros following one of the suggested ways, but, how can you call them from other macros? More importantly, what will happen if the hidden macros are in one module and the caller macros are in a different one? In that case, you can follow one of the solutions below: