VBA Excel使用另一个模块中的整数变量 [英] VBA Excel Use integer variable from another module

查看:80
本文介绍了VBA Excel使用另一个模块中的整数变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有

Dim PackageInnerHorizontalwidth As Single

在"Public Sub PackageDimensionsCalculator()"中,这是一些计算的结果.现在,我需要使用该结果值"PackageInnerHorizo​​ntalwidth"在模块"Function EvaluateFormatSketch()As Boolean"中并将该值返回为"0".这不是所有计算后的实际结果值.我试图做到这一点

In "Public Sub PackageDimensionsCalculator()" which is a result of some calculations. Now I need to use that resulting value "PackageInnerHorizontalwidth" in Module "Function EvaluateFormatSketch() As Boolean" And it returns that value as "0" which is not the actual resulting value after all teh calculations. I tried to make that first

Dim PackageInnerHorizontalwidth As Single

全球和公众,但没有成功.我了解这不是我的方法.

Global and public but with no success. I understand that it's not the way to do that in my case.

所以我的问题是:如何获取"PackageInnerHorizo​​ntalwidth"作为模块"Function EvaluateFormatSketch()As Boolean"中的值?

So my question is: How to get "PackageInnerHorizontalwidth" as value in module "Function EvaluateFormatSketch() As Boolean"?

现在我拥有它

Dim PackageInnerHorizontalwidth As Integer

请有人帮我做这个吗?

推荐答案

全球和公众,但没有成功.我了解这不是在我的情况下可以做到这一点.

Global and public but with no success. I understand that it's not the way to do that in my case.

但是是.放置:

Public PackageInnerHorizontalwidth As Single

位于模块顶部(功能外部/之前),并消除功能中所有变暗的颜色.

in the top of the module (outside/before your function) and remove any dimming of it in the functions.

这篇关于VBA Excel使用另一个模块中的整数变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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