ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copy formula (https://www.excelbanter.com/excel-programming/289090-copy-formula.html)

Beesht[_6_]

copy formula
 
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.


---
Message posted from http://www.ExcelForum.com/


Tom Ogilvy

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

--
Regards,
Tom Ogilvy


Beesht wrote in message
...
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.


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 09:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com