Hi All,

I have a worksheet with a changing number of rows each week and need to automate a SUMIF formula within that worksheet.

Here's what I have so far:

ActiveCell.FormulaR1C1 = _
"=SUMIF(R[-881]C[-12]:R[-1]C[-12],""*Total*"",R[-881]C:R[-1]C)"

Instead of Active.Cell, I need it to find the last cell in column "N" that contains data, and insert the SUMIF formula in the same cell in column "O". I also need the SUMIF itself to change ranges as the rows of data expand or contract (instead of just to row 881 - it might be 881 rows one week, and 5000 the next).

The formula is summing as follows: check column C for the word "Total" and sum the corresponding cells in column "O".

ANy help would be most appreciated.