Excel VBA中的索引和聚集功能
我正在尝试将一个单元格公式转移到VBA,因为否则它总是在重新计算,即使我停用Excel选项,它也会在我重新打开文件时返回。这就是为什么我想将该公式移至VBA,只有在我按下按钮时才会发生这种情况,这更聪明。
我有一个带有数据的主表,我将其汇总和索引并在表中的另一个表上表达。 - > A列到S在主表中,在聚合表中,我只有A,C,E,G,H,I,J,K,L,M和P列,
我想搬到VBA IS以下内容:
=IFERROR(INDEX(Endkontrolle!$A:$S;AGGREGATE(15;6;ROW(Endkontrolle!$A:$S)/((FIND($B$3;Endkontrolle!$F:$F;1)>0)*(Endkontrolle!$S:$S="x"));ROW()-32)-0;1);"")
有人可以帮助我将该公式转换为VBA脚本吗?
非常感谢
I'm trying to move an in cell formula to VBA, because otherwise it's always recalculating, even when I deactivate the excel option, it comes back when I reopen the file. That's why I want to move that formula to VBA, where it happens only when I press a button, which is much smarter.
I have a master table with data, which I aggregate and index and express it on another sheet in a table. -> column A to S are in the master table, in the aggregated table, I will only have column A,C,E,G,H,I,J,K,L,M and P
The formula I want to move to VBA is the following:
=IFERROR(INDEX(Endkontrolle!$A:$S;AGGREGATE(15;6;ROW(Endkontrolle!$A:$S)/((FIND($B$3;Endkontrolle!$F:$F;1)>0)*(Endkontrolle!$S:$S="x"));ROW()-32)-0;1);"")
Can somebody help me translate that formula to VBA script?
thank you very much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试此代码:
Try this code:
谢谢你。我实现了它,它适用于1行。如果我想从主表中添加下一个数据集,则仅重复上一行中的内容。我该如何实现,它列出了我超过1行的汇总数据?
预期结果:
它选择了相关的数据行,并列出了它(根据发现标准不同的数据)
实际结果:
它仅选择1行,然后重复第二行
,现在我定义了以下代码:
end sub
Thanks for that. I implemented it and it works for 1 row. If I want to add the next data set from the main table, that does only repeat the content from previous row. How can I achieve, that it lists me more than 1 line of aggregated data?
Expected result:
it picks the relevant rows of data and lists it (different data according the find criteria)
Actual result:
it picks only 1 row and repeats it for the second line
Now I defined following code:
End Sub
这是主表“ Endkontrolle”中的数据示例:
在报告页面上,我想列出多达20行数据,这些数据位于“ Endkontrolle”工作表的日期范围('x')中。
在上面的示例中,它应列出第1行1+2,而不是3。
Here's a sample of the data in the main table "Endkontrolle":
On the reporting page, I would like to list down up to 20 rows of Data, which are in the Date Range ('x') from the "Endkontrolle" worksheet.
In the upper example, it should list row 1+2, but not 3.