问题标签 [spill-range]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
32 浏览

excel - 将溢出范围传递给 VBA 时遇到问题 - 仅获取应用程序定义或对象定义的错误

我在将 Spill 数组传递给 VBA 时遇到问题。该范围由名称“ListCurJobs”和等式定义

=UNIQUE(FILTER(CtrlSht!$B:$B,CtrlSht!$B:$B<>""))

使用“=ListCurJobs”测试工作表上的命名范围会按预期返回溢出的范围。

我正在尝试使用

这适用于标准数组,但使用溢出数组我得到错误:Application-defined or object-defined error

编辑:跟进 - 我设法通过更改命名范围 listCurJobs 以使用 Offset 函数来解决这个问题

=OFFSET(CtrlSht!$E$1,0,0,CtrlSht!$D$1)

其中 CtrlSht!$D$1 通过计算 E 中的所有项目

=COUNTA(E1#)

并且 E1 具有我试图在命名范围内使用的溢出功能,即

=UNIQUE(FILTER(CtrlSht!$B:$B,CtrlSht!$B:$B<>""))

无论导致原始错误的原因是什么,这些额外的步骤似乎都可以避免它。