Complie error: Expected: end of statement

D

diepvic

Hi,
I've got a macro code as below:
Range("A1").FormulaArray = _
"=if(B1="Loan",D1,0)"

And it causes a compile error. How should I fix it if I want to keep the
text Loan in my formula.

Thanks so much
 
M

Mike H

Hi,

Firstly it's not an array formula and so no need for FormulaArray and second
double up on the quotes to solve your problem

Range("A1").Formula = "=if(B1=""Loan"",D1,0)"

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top