copy formula

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.
 
T

Tom Ogilvy

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 & ")"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top