如何使用variables作为vba中sumifs公式的标准

任何人都可以帮我修改下面的代码:

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

我需要用variablesreplace代码的""=XYZ""部分

喜欢这个?

 Dim Medium As String Medium = "XYZ" ActiveCell.FormulaR1C1 = "=SUMIFS(List2!C[8],List2!C[2]," & _ Chr(34) & _ Medium & _ Chr(34) & _ ",List2!C[11],""=prime"")"