I'm using Excel 2010 VBA. Here is the issue I'm facing.
I would like to insert a formula into cell Q2 and copy it down to the rest of the rows in that column (number of rows will vary). Here is the code I have, but I keep getting a syntax error. I don't why for sure, but I suspect it has to do with the "{" and "}" symbols in the formula. Can anyone confirm and suggest a workaround?
I would like to insert a formula into cell Q2 and copy it down to the rest of the rows in that column (number of rows will vary). Here is the code I have, but I keep getting a syntax error. I don't why for sure, but I suspect it has to do with the "{" and "}" symbols in the formula. Can anyone confirm and suggest a workaround?
Code:
Range("Q2).Formula = "=SUM(COUNTIF(P2,{"Account*No Debits",_ "Account*No Credits","Account*Dormant","Whereabouts Unknown",_
"Cheque*Used","Cheque*not Found","Account*Blocked","Account*Frozen",_
"Payment involving crisis related customer or institution. Do you want to proceed ?", _
"Cheque missing or Account mismatch"}))>0"