What I'm trying to do is do a sumif where I take an id from sheet2 (the active sheet), look it up on sheet1 and sum data from from sheet1. I then print the result in a cell in sheet2 (the activecell.offset = ).
ActiveCell.Offset(m, n) = WorksheetFunction.SumIf(Sheets("Sheet1").Range("B:B"), Sheets("Sheet2").Cells(m, 1), Sheets("Sheet1").Range(Cells(1, covcol), Cells(5000, covcol)))
I believe the problem is trying to reference a cell on a different worksheet. Is there a direct solution or are my choices (1) use a loop with if as a sumif proxy or (2) insert sumif excel formulas into each cell? Since there's already a nested loop, I'd rather not introduce further complexity.
Thanks!