SUMIFS with relative reference r1c1

M

MikeF

Have to SUMIFS some columns in a Grand Total row, which in the following
example happens to be on row 53, but could end up in any row from 10 to 500.

Have designated FinalRow as whatever the Grand Total row is, -1.

Would like it to calc "sumifs columns b thru v, from row 6 down to FinalRow
[or from FinalRow up to row 6], as long as any row in column a contains the
text "total".

At present it's static, as I can't seem to get the FinalRow worked into it ...

ActiveCell.Range("b1.v1").FormulaR1C1 =
"=SUMIFS(R[-46]C:R[-1]C,R7C1:R52C1,""*total"")"

Any assistance would be sincerely appreciated.
Regards,
- Mike
 
D

Dave Peterson

Maybe...

ActiveCell.Range("b1:v1").FormulaR1C1 =
"=SUMIFS(R6C:R[-1]C,R7C6:R[-1]C1,""*total"")"

Change the 6's to whatever your first row is.

And I changed b1.v1 to b1:v1, too.
Have to SUMIFS some columns in a Grand Total row, which in the following
example happens to be on row 53, but could end up in any row from 10 to 500.

Have designated FinalRow as whatever the Grand Total row is, -1.

Would like it to calc "sumifs columns b thru v, from row 6 down to FinalRow
[or from FinalRow up to row 6], as long as any row in column a contains the
text "total".

At present it's static, as I can't seem to get the FinalRow worked into it ...

ActiveCell.Range("b1.v1").FormulaR1C1 =
"=SUMIFS(R[-46]C:R[-1]C,R7C1:R52C1,""*total"")"

Any assistance would be sincerely appreciated.
Regards,
- Mike
 
M

MikeF

Yup, that's it.
Thanx Dave.
I ended up figuring it out.
.... Was over-complicating it, and stewed myself into a corner.
Hate it when that happens!

Dave Peterson said:
Maybe...

ActiveCell.Range("b1:v1").FormulaR1C1 =
"=SUMIFS(R6C:R[-1]C,R7C6:R[-1]C1,""*total"")"

Change the 6's to whatever your first row is.

And I changed b1.v1 to b1:v1, too.
Have to SUMIFS some columns in a Grand Total row, which in the following
example happens to be on row 53, but could end up in any row from 10 to 500.

Have designated FinalRow as whatever the Grand Total row is, -1.

Would like it to calc "sumifs columns b thru v, from row 6 down to FinalRow
[or from FinalRow up to row 6], as long as any row in column a contains the
text "total".

At present it's static, as I can't seem to get the FinalRow worked into it ...

ActiveCell.Range("b1.v1").FormulaR1C1 =
"=SUMIFS(R[-46]C:R[-1]C,R7C1:R52C1,""*total"")"

Any assistance would be sincerely appreciated.
Regards,
- Mike
 
D

Dave Peterson

I screwed it up!

ActiveCell.Range("b1.v1").FormulaR1C1 _
= "=SUMIFS(R6C:R[-1]C,R6C1:R[-1]C1,""*total"")"



Dave said:
Maybe...

ActiveCell.Range("b1:v1").FormulaR1C1 =
"=SUMIFS(R6C:R[-1]C,R7C6:R[-1]C1,""*total"")"

Change the 6's to whatever your first row is.

And I changed b1.v1 to b1:v1, too.
Have to SUMIFS some columns in a Grand Total row, which in the following
example happens to be on row 53, but could end up in any row from 10 to 500.

Have designated FinalRow as whatever the Grand Total row is, -1.

Would like it to calc "sumifs columns b thru v, from row 6 down to FinalRow
[or from FinalRow up to row 6], as long as any row in column a contains the
text "total".

At present it's static, as I can't seem to get the FinalRow worked into it ...

ActiveCell.Range("b1.v1").FormulaR1C1 =
"=SUMIFS(R[-46]C:R[-1]C,R7C1:R52C1,""*total"")"

Any assistance would be sincerely appreciated.
Regards,
- 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