将MAX函数转换为VBA中的WorksheetFunction.Max。

huangapple go评论78阅读模式
英文:

convert MAX function to WorksheetFunction.Max for VBA

问题

如何在VBA的Application.WorksheetFunction.Max方法中编写以下公式:

=MAX((B2:B12)*(D2:D12<>"SYSTEM")*(D2:D12<>"VOID"))

最初我想要在VBA中使用Application.WorksheetFunction.Maxifs来实现以下公式:

=MAXIFS(B2:B12, D2:D12, "<>SYSTEM", D2:D12, "<>VOID")

但我找不到如何编写它的方法。

英文:

How do I write the formula

=MAX((B2:B12)*(D2:D12&lt;&gt;&quot;SYSTEM&quot;)*(D2:D12&lt;&gt;&quot;VOID&quot;))

in Application.WorksheetFunction.Max method for VBA?

I initially wanted to use Application.WorksheetFunction.Maxifs for

=MAXIFS(B2:B12,D2:D12,&quot;&lt;&gt;SYSTEM&quot;,D2:D12,&quot;&lt;&gt;VOID&quot;)

but couldn't find a way to write it

答案1

得分: 1

MAXIFS函数应该可以工作,请以以下格式尝试:

WorksheetFunction.MaxIfs(Range("B2:B12"), Range("D2:D12"), "<>SYSTEM", Range("D2:D12"), "<>VOID")
英文:

The MAXIFS function should work, try it in this format:

WorksheetFunction.MaxIfs(Range(&quot;B2:B12&quot;), Range(&quot;D2:D12&quot;), &quot;&lt;&gt;SYSTEM&quot;, Range(&quot;D2:D12&quot;), &quot;&lt;&gt;VOID&quot;)

huangapple
  • 本文由 发表于 2023年7月23日 21:42:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/76748554.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定