Call a Subroutine from a different Module in VBA

VbaModuleCall

Vba Problem Overview


Is it possible to call a function from one Module to another?

I have the following code:

Sub MAIN()
    Call IDLE
End Sub
  • MAIN is located in Module1
  • IDLE is located in Module2 and defined as: Sub IDLE()

Vba Solutions


Solution 1 - Vba

Prefix the call with Module2 (ex. Module2.IDLE). I'm assuming since you asked this that you have IDLE defined multiple times in the project, otherwise this shouldn't be necessary.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNimrodView Question on Stackoverflow
Solution 1 - VbadcpView Answer on Stackoverflow