a1={SUM(IF(LEFT(L4:L15000,2)="政策",F4:F15000))} 在vba 中怎么写
发布网友
发布时间:2024-10-20 23:11
我来回答
共2个回答
热心网友
时间:2024-11-08 02:09
你用录制宏的方法。把公式填好后,就看到结果了。如下
Selection.FormulaArray = _
"=SUM(IF(R4C2:R15000C2=R[-6]C[21],(R1C6:R15000C6)*(R1C7:R15000C7)/10000))"
下面不是数组公式的代码,比较一下
Selection.FormulaR1C1 = _
"=SUM(IF(R4C2:R15000C2=R[-8]C[21],(R1C6:R15000C6)*(R1C7:R15000C7)/10000))"
热心网友
时间:2024-11-08 02:10
Sub MM()
Dim I As Integer
For I = 1 To 100
Cells(I, 1).FormulaArray = "=SUM(IF($B$4:$B$15000=AD" & I & ",($F$1:$F$15000)*($G$1:$G$15000)/10000))"
Next I
End Sub
热心网友
时间:2024-11-08 02:09
你用录制宏的方法。把公式填好后,就看到结果了。如下
Selection.FormulaArray = _
"=SUM(IF(R4C2:R15000C2=R[-6]C[21],(R1C6:R15000C6)*(R1C7:R15000C7)/10000))"
下面不是数组公式的代码,比较一下
Selection.FormulaR1C1 = _
"=SUM(IF(R4C2:R15000C2=R[-8]C[21],(R1C6:R15000C6)*(R1C7:R15000C7)/10000))"
热心网友
时间:2024-11-08 02:10
Sub MM()
Dim I As Integer
For I = 1 To 100
Cells(I, 1).FormulaArray = "=SUM(IF($B$4:$B$15000=AD" & I & ",($F$1:$F$15000)*($G$1:$G$15000)/10000))"
Next I
End Sub