Overcome "expected end of statement error"

  • Thread starter Thread starter burl_rfc
  • Start date Start date
B

burl_rfc

I'm trying to insert the following formual in the actice cell, the VBA
editor gives me a error "expected end of statement". It is likely
caused by the parenthesis around the ">0", once I remove them from the
">0" and make it >0 for example the error goes away, but obvioulsy my
formula would then not work. Any suggestions on how to get around
this.

ActiveCell.FormulaR1C1 = "=(SUMIF(OFFSET(Total,0,1),">0",Total))"

Thanks
burl_rfc
 
try. Notice the double quotes

ActiveCell.Formula = "=SUMIF(OFFSET(Total,0,1),"">0"",Total)"
 
ActiveCell.FormulaR1C1 = "=(SUMIF(OFFSET(Total,0,1),"">0"",Total))"

to make it work you have to use double quotes
:)
susan
 

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

Similar Threads


Back
Top