PC Review


Reply
Thread Tools Rate Thread

Complie error: Expected: end of statement

 
 
diepvic
Guest
Posts: n/a
 
      24th Jun 2009

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
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      24th Jun 2009

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

"diepvic" wrote:

> 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

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Expected Array error during complie Jim Microsoft Access VBA Modules 6 11th Aug 2008 06:16 PM
End of statement expected error momo Microsoft ASP .NET 2 20th Mar 2006 11:34 PM
Expected Statement Error =?Utf-8?B?QmlsbA==?= Microsoft Frontpage 4 2nd Nov 2005 11:42 AM
Dlookup function in a SQL Statement giving Error Expected: End of Statement Edward S Microsoft Access 1 19th May 2004 02:41 AM
Dlookup function in a SQL Statement giving Error Expected: End of Statement Edward S Microsoft Access 1 17th May 2004 08:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:21 PM.