.Range("BS2:BS" & NewLastRow).Formula = "=IF((OR(BR2=""FLAG"",BO2>0)),""FLAG"",""NOFLAG"" ))"
我在VBA中使用此公式,但它不起作用。语法看起来很好。
答案 0 :(得分:3)
太多“)”
.Range("BS2:BS" & NewLastRow).Formula = "=IF(OR(BR2=""FLAG"",BO2>0),""FLAG"",""NOFLAG"" )"
答案 1 :(得分:2)
一般情况下,请尝试以下方法:
Public Sub PrintMeUsefulFormula()
Dim strFormula As String
Dim strParenth As String
strParenth = """"
strFormula = Selection.Formula
strFormula = Replace(strFormula, """", """""")
strFormula = strParenth & strFormula & strParenth
Debug.Print strFormula
End Sub