I know there are various threads out there about this, but I haven't been able to make this work. I am trying to input a formula (and it needs to be a formula, not just the current answer) that is
I know this formula doesn't work, but I cannot seem to figure out what the correct syntax is. As an example, my cursor is in J6 and I need the sum of J6:J? (the last continuous cell with data above J6), multiplied by H8, and put the formula in J8.
And I cannot used the fixed cell numbers on any of it, because I never know how large the table is that I'm manipulating.
Code:
activecell.offset(2,0).formula = sum(activecell:selection.end(x1up))*activecell.offset(2,-2)
I know this formula doesn't work, but I cannot seem to figure out what the correct syntax is. As an example, my cursor is in J6 and I need the sum of J6:J? (the last continuous cell with data above J6), multiplied by H8, and put the formula in J8.
And I cannot used the fixed cell numbers on any of it, because I never know how large the table is that I'm manipulating.