Excel VBA变量声明琥珀

发布于 2025-02-13 01:10:16 字数 721 浏览 1 评论 0 原文

在一个很棒的VBA代码示例中 @

Function DistinctVals(arr, Optional col = 1)
    Dim i&, v: v = arr

noreferrer“ > BYREF参数类型不匹配。 我的问题不是关于不匹配的 - 甚至词典都无法在Mac上使用,但这是关于以前从未见过的,并且在搜索引擎中找不到“ dim i& ”声明。在其他语言中,琥珀色代表参考,但是a)在这种情况下,这是没有意义的,b)没有记录 - 至少我找不到任何东西。

提前感谢

In a great VBA code example @https://medium.com/@daniel.ferry/excel-vba-get-unique-values-easily-592162f52c6e there is followng Variable declaration:

Function DistinctVals(arr, Optional col = 1)
    Dim i&, v: v = arr

Everthing works fine in Windows but on Mac there is a ByRef argument type mismatch.
My question is not about the mismatch - there is even Dictionary not working on Mac, but it's about the never seen before and can't find with search engine "Dim i&" Declaration. In other languages the ambersand stands for Reference, but a) this does not make sense in this context and b) it's not documented - at least I can't find any.

Dim declaration with ambersand

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

愿得七秒忆 2025-02-20 01:10:16

这意味着类型。来自

类型的速记为:%-Integer; & -长的; @ -货币; # -双倍的;呢-单身的; $ -String

This means Long type. From VBA reference:

The shorthand for the types is: % -integer; & -long; @ -currency; # -double; ! -single; $ -string

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文