Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default 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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Block copy/insert of 5 rows, then update formula below? David Excel Worksheet Functions 2 October 15th 08 05:35 PM
Insert Row - Stop Automatic Formula Update Kevin Excel Worksheet Functions 1 July 8th 08 10:09 AM
Insert row above Sum - update formula Saintsman Excel Programming 1 February 8th 07 12:54 PM
Row insert fails to update Sum formula quartz[_2_] Excel Programming 6 April 3rd 05 10:59 PM
insert or update Laurent M Excel Programming 2 February 2nd 05 10:21 AM


All times are GMT +1. The time now is 05:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"