For something like summing a column, I’d normally just type “=Sum(A2:A8905).” Only issue is I’m trying to convert someone’s old code into something new, and I’m unsure of how to write the formulas for dynamic ranges. A8905 won’t always be 8905 for further clarification.
if I’m designating erow = ws.range("A2").end(xldown).row
to find the row, how do I combine this into my sum formula?
the old formula uses defined functions the previous guy created that I can’t use for what I’m building. It looks like this:
.cells(1,i).formula = "=SUM(" & col(i) & (srow + 3) & ":" & _ col(i) & (erow + 6) & ")"
srow and erow being start row and end row respectively.
This code just gives me compile errors (end of statement)
.cells(1,2).formula = "=SUM("A* & ":" & erow)"
Additionally, any help with figuring out how to do sumproducts with this would be great.