从 VBA 中的不同模块调用子程序 [英] Call a Subroutine from a different Module in VBA

查看:108
本文介绍了从 VBA 中的不同模块调用子程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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()

解决方案

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.

这篇关于从 VBA 中的不同模块调用子程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆