我在VBA中遇到Sum Countifs公式时遇到麻烦。我已经尝试过括号和数组。下面是Array尝试
Dim finRow As String
finRow = Sheets("Sheet1").Range("A500000").End(xlUp).Row
Sheets("Macro").Range("B51") = WorksheetFunction.Sum(WorksheetFunction.CountIfs(.Range("E2:E" & finRow), Array("Positions - Active Recruitment", "Positions - Not Actively Recruiting"), .Range("B2:B" & finRow), "=" & Sheets("Macro").Range("$E$3").Value, .Range("Y2:Y" & finRow), "=Contingent Worker", .Range("T2:T" & finRow), "=" & Sheets("Macro").Range("$D$3").Value))
下面是尝试使用括号的方法,该错误使我在VBA中出现无效的字符错误
Sheets("Macro").Range("B51") = WorksheetFunction.Sum(WorksheetFunction.CountIfs(.Range("E2:E" & finRow), {""=Positions - Active Recruitment"", ""Positions - Not Actively Recruiting""}, .Range("B2:B" & finRow), "=" & Sheets("Macro").Range("$E$3").Value, .Range("Y2:Y" & finRow), "=Contingent Worker", .Range("T2:T" & finRow), "=" & Sheets("Macro").Range("$D$3").Value))
任何帮助将不胜感激。谢谢!马特