SumIf in ActiveCell.FormulaR1C1 ?

R

RitaP

I want to change this
ActiveCell.FormulaR1C1 = "=SUM(R[-8]C:R[-1]C)"

so that if the value summed would equal 0 that the the cell is left blank.

Would appreciate if anyone could post the correct formula for this. Thanks.
 
M

Marcelo

Try this

hth
regards from Brazil


ActiveCell.FormulaR1C1 = "=IF(SUM(R[-8]C:R[-1]C)=0,"",SUM(R[-8]C:R[-1]C)"

"RitaP" escreveu:
 
R

RitaP

I pasted in your formula but I'm getting error 1004 application-defined or
object-defined error.

Rita

Marcelo said:
Try this

hth
regards from Brazil


ActiveCell.FormulaR1C1 = "=IF(SUM(R[-8]C:R[-1]C)=0,"",SUM(R[-8]C:R[-1]C)"

"RitaP" escreveu:
I want to change this
ActiveCell.FormulaR1C1 = "=IF(SUM(R[-8]C:R[-1]C)=0,0,SUM(R[-8]C:R[-1]C)"

so that if the value summed would equal 0 that the the cell is left blank.

Would appreciate if anyone could post the correct formula for this. Thanks.
 
R

RitaP

I got it working, just needed to add a couple more quotes to your formula
Marcelo. My thanks to you for pointing me in right direction.

Formula that worked:
ActiveCell.FormulaR1C1 = "=IF(SUM(R[-8]C:R[-1]C)=0,"""",SUM(R[-8]C:R[-1]C))"


Marcelo said:
Try this

hth
regards from Brazil


ActiveCell.FormulaR1C1 = "=IF(SUM(R[-8]C:R[-1]C)=0,"",SUM(R[-8]C:R[-1]C)"

"RitaP" escreveu:
I want to change this
ActiveCell.FormulaR1C1 = "=IF(SUM(R[-8]C:R[-1]C)=0,0,SUM(R[-8]C:R[-1]C)"

so that if the value summed would equal 0 that the the cell is left blank.

Would appreciate if anyone could post the correct formula for this. Thanks.
 

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