copy formula

  • Thread starter Thread starter Beesht
  • Start date Start date
B

Beesht

I am trying to copy a formula from one sell to several other cells.
I want to add up all the cells in a column with the total at the bottom
in d51, I have pressed auto sum for this single cell and included all
the cells that I want d2:d49 but when I try to copy the formula to
other cells in row d51 its also copying the figure from that cell.

Any help would be grate Thnaks.
 
there is nothing magical about formula created with autosum. Autosum does
the work of determining a range, then enters a formula to reflect that
range. Copying the formula would behave the same as copying any other
formula.

If you want to perform as autosum, you could write your code to do that. As
an example, placing a formula in the activecell which is just below the data
to be summed.

set rng = Range(ActiveCell.offset(-1,0).End(xlup),ActiveCell.offset(-1,0))
ActiveCell.formula = "=Sum(" & rng.Address & ")"
 
Back
Top