ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   vba insert row does not update Sum formula (https://www.excelbanter.com/excel-programming/432678-vba-insert-row-does-not-update-sum-formula.html)

Harold Good

vba insert row does not update Sum formula
 
Hi,

I have code that inserts a row for additional data that needs to be summed.
But the sum formula below this new row does not update to include the newly
increased number of rows.

The only thing I have found in the forums is someone's suggestion to always
leave a blank row just above the sum formula, and insert new rows above it.

I have not tried this because it seems most inelegant!

It seems there must be a way this can be done.

Thanks for any insights you may have.

Harold



Gord Dibben

vba insert row does not update Sum formula
 
=SUM(A1:INDEX(A:A,ROW()-1))

Entered below current data in column A

As you insert rows above and add new values, the SUM range will include the
new rows and values.


Gord Dibben MS Excel MVP

On Thu, 20 Aug 2009 15:31:15 -0500, "Harold Good"
wrote:

Hi,

I have code that inserts a row for additional data that needs to be summed.
But the sum formula below this new row does not update to include the newly
increased number of rows.

The only thing I have found in the forums is someone's suggestion to always
leave a blank row just above the sum formula, and insert new rows above it.

I have not tried this because it seems most inelegant!

It seems there must be a way this can be done.

Thanks for any insights you may have.

Harold



Harold Good

vba insert row does not update Sum formula
 
Thanks very much, I hadn't thought of doing it with a different formula.

Harold

"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
=SUM(A1:INDEX(A:A,ROW()-1))

Entered below current data in column A

As you insert rows above and add new values, the SUM range will include
the
new rows and values.


Gord Dibben MS Excel MVP

On Thu, 20 Aug 2009 15:31:15 -0500, "Harold Good"
wrote:

Hi,

I have code that inserts a row for additional data that needs to be
summed.
But the sum formula below this new row does not update to include the
newly
increased number of rows.

The only thing I have found in the forums is someone's suggestion to
always
leave a blank row just above the sum formula, and insert new rows above
it.

I have not tried this because it seems most inelegant!

It seems there must be a way this can be done.

Thanks for any insights you may have.

Harold






All times are GMT +1. The time now is 10:16 AM.

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