MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Help needed totaling & counting ranges


Posted by Gary on October 05, 2001 6:55 AM

I'm having a dumb attack with a macro I'm trying to write. I need to calculate columnular totals from within a range and put the values of those totals into a different worksheet. The range is not of a fixed length . Is there an easy way of doing this??

Thanks


Posted by Barrie Davidson on October 05, 2001 7:04 AM

Gary, you can try this (assumes the data being summed is in "Sheet2" and that you are putting the formula in cell A1 of the active sheet).

Range("A1").Formula = "=SUM(Sheet2!" & Sheets("Sheet2").Range("A1", Sheets("Sheet2").Range("A1").End(xlDown).Address).Address & ")"

Regards,
BarrieBarrie Davidson