Do you really need such a button, can't you just use the
SUM Worksheet Function with a range.
Aren't there better solutions:
Use of OFFSET allows you to insert and delete rows
right up to inserting a line before the SUM formula.
A30: =SUM(A2:OFFSET(A30,-1,0))
would sum numbers from A2:A29
You can use the SUM button, which would, I think,
be preferable to your request but it does have a problem
if you insert after or delete the last reference in the range.
By adding in cells one by one you have the advantage
or disadvantage of getting a #Value! if a cell contains text.
But you should be aware that there is a specification limit as to the
size of a formula.
Arguments in a function 30
Length of formula contents 1,024 characters
The second one could be a problem for you, as you could only
reach up to 228 cells to be added from a column, if
you include all of the individual addresses.
i.e.
A229: =SUM(A2:OFFSET(A227,-1,0))
as opposed to your
A229: =A1+A2+A3+A4+A5+A6+A7+A8+A9+A10+A11+A12+ ... + A228)
Hope you are not using this for a running total,
which could take outlandish calculation times by adding up the same
numbers over an over as opposed to the previous running total + increment.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages:
http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page:
http://www.mvps.org/dmcritchie/excel/search.htm
"sameerce " wrote in message ...
Thanks a ton to all. It worked.
---
Message posted from http://www.ExcelForum.com/