Insert row, update total formula to include new row

zJenkins

Board Regular
Joined
Jun 5, 2015
Messages
148
Hi,

I've got $ figures in range I14:T20, and each respective column has a subtotal formula
Code:
=SUBTOTAL(9,I14:I20), =SUBTOTAL(9,J14:J20), etc

The user can run a macro to insert a line at the bottom of the data which will then be populated with $ figures. My question is, when the row is inserted, how can I update the subtotal formulas to now include the new row? In this case it would be row 21.

Thanks for your time.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
If you were to insert a row within I14:I20, the formulas would automatically expand to I14:I21 to accommodate the inserted row and keep the original cells.

Have your formulas include one blank row at the bottom, and have your macro insert a row just above it. Then your formuluas will automatically expand their ranges.
 
Last edited:
Upvote 0
If you were to insert a row within I14:I20, the formulas would automatically expand to I14:I21 to accommodate the inserted row and keep the original cells.

Have your formulas include one blank row at the bottom, and have your macro insert a row just above it. Then your formulas will automatically expand their ranges.

Thanks for the reply AlphaFrog, that was one thing I considered, however, because of user preferences, I want to avoid the extra blank row.
 
Upvote 0
Then have the macro insert a row above the last row. The last row will shift down. Copy the last row to the newly inserted row above. Then paste new data in the last row.
 
Upvote 0

Forum statistics

Threads
1,223,702
Messages
6,173,969
Members
452,539
Latest member
delvey

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top