有没有办法在VBA中知道没有被使用的变量?

有没有办法在VBA中知道没有被使用的变量?

问题描述:

在VBA中有一个工具,方法或设置来警告已经 Dim 'med的变量,但是没有被使用?

Is there a tool, method or setting in VBA to warn about variables that have been Dim'med, but aren't being used?

MZ-Tools 将搜索您的代码,并告诉您什么是没有被使用。 VBA的版本可以在这里找到。

MZ-Tools will search through your code and tell you what is not being used. The version for VBA can be found here.

MZ-Tools中执行您所要求的具体功能是查看源代码

The specific feature in MZ-Tools that performs what you asking about is Review Source Code:


查看源代码功能允许
将源代码检查为
检测一些未使用的声明
(常量,变量,参数,
程序等)。

The Review Source Code feature allows you to review the source code to detect some unused declarations (constants, variables, parameters, procedures, etc.).