1

任何人都可以帮助我更正以下代码:

Dim Medium As String

Medium = "XYZ"

ActiveCell.FormulaR1C1 = "=SUMIFS(List2!C[8],List2!C[2],""=XYZ"",List2!C[11],""=prime"")"

我需要""=XYZ""用变量替换部分代码

4

1 回答 1

3

像这样?

Dim Medium As String    
Medium = "XYZ"    
ActiveCell.FormulaR1C1 = "=SUMIFS(List2!C[8],List2!C[2]," & _
                         Chr(34) & _
                         Medium & _
                         Chr(34) & _
                         ",List2!C[11],""=prime"")"
于 2013-02-19T09:17:35.443 回答