ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SumIf in ActiveCell.FormulaR1C1 ? (https://www.excelbanter.com/excel-programming/367856-sumif-activecell-formular1c1.html)

RitaP

SumIf in ActiveCell.FormulaR1C1 ?
 
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.

Marcelo

SumIf in ActiveCell.FormulaR1C1 ?
 
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.


RitaP

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

Rita

"Marcelo" wrote:

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.


RitaP

SumIf in ActiveCell.FormulaR1C1 ?
 
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" wrote:

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.



All times are GMT +1. The time now is 10:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com