问题
Is it possible to call a function from one Module to another?
I have the following code:
Sub MAIN()
Call IDLE
End Sub
MAINis located inModule1IDLEis located inModule2and defined as:Sub IDLE()
回答1:
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.
来源:https://stackoverflow.com/questions/2804327/call-a-subroutine-from-a-different-module-in-vba