Reputation: 73
.Range("BS2:BS" & NewLastRow).Formula = "=IF((OR(BR2=""FLAG"",BO2>0)),""FLAG"",""NOFLAG"" ))"
I am using this formula in VBA but it is not working. Syntax looks fine.
Upvotes: 0
Views: 96
Reputation: 43565
In general, try the following:
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
Source: Apply formula in VBA?
Upvotes: 2
Reputation: 152450
Too many ")"
.Range("BS2:BS" & NewLastRow).Formula = "=IF(OR(BR2=""FLAG"",BO2>0),""FLAG"",""NOFLAG"" )"
Upvotes: 3