Auto adjust cells/rows below table when adding data

JustP

New Member
Joined
May 18, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hi there guys.

I have a table on a page, called the "Final Table", and right below it there's a "total" row. Now, my plan is to have this table dynamically resize by taking its data from different other data tables in another sheets. I'm going to have this sheet write protected, and whenever I feed more data into the data tables this "Final Table" might increase in rows.

What I want to do is, if possible without VBA due to security workarounds being necessary, make the "Total" row automatically move downwards or upwards as the "Final Table" increases or decreases in row count. Is this at all possible or am I just dreaming?

Example of how it looks (although the data tables might be on completely different sheets, even workbooks depending on the situation):
1) "Tiny Table" reads from "Data table 1" and populates its rows. "Total" adjusts automatically:
Bok1
ABCDEFG
1Tiny TableAmountCostData table 1 (in another sheet)AmountCost
2Product A150Product A150
3Product F2100Product F2100
4
5Total3250
Blad1
Cell Formulas
RangeFormula
B5B5=SUM(Tabell1[Amount])
C5C5=SUM((B2*C2)+(B3*C3))


2) Only adding one row to "Data table 1" is causing "Tiny Table" to become one row longer and almost overwriting the "Total" row:
Bok1
ABCDEFG
1Tiny TableAmountCostData table 1 (in another sheet)AmountCost
2Product A150Product A150
3Product F2100Product F2100
4Product Q1200Product Q1200
5Total4450
Blad1
Cell Formulas
RangeFormula
B5B5=SUM(Tabell1[Amount])
C5C5=SUM((B2*C2)+(B3*C3)+(B4*C4))


So, what I want is the "Total" row to always stay with one row between itself and "Tiny Table", but avoid VBA by any means necessary (if possible). Any tricks are welcome. Haven't got it working by grouping or anything.

Best regards,
P
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
I can't seem to edit posts, but just to clarify. This example doesn't contain the auto-populate functionality. I just made a small "demo" sheet to show what I needed without too much overhead data.
 
Upvote 0
Do not tables include a total row automaticall? I think it would be row 5 in the second example.

just thinking
 
Upvote 0
Welcome to the MrExcel board!

Any tricks are welcome.
For that sort of thing I put the totals at the top. That way ..
  • You don't ever have the problem of adjusting rows like you are asking about here, and
  • The totals are (or can be made to be) always visible at the top of the sheet (by using FreezePanes) without scrolling, no matter how big the table below gets. Those totals are also right near the relevant table heading so that if you have a lot of columns in your table it is still very easy to tell which value refers to which heading.

22 05 20.xlsm
ABCDEFG
1Total4450Data table 1 (in another sheet)AmountCost
2Product A150
3Tiny TableAmountCostProduct F2100
4Product A150Product Q1200
5Product F2100
6Product Q1200
7
8
Table Totals
Cell Formulas
RangeFormula
B1B1=SUM(TinyTable[Amount])
C1C1=SUMPRODUCT(TinyTable[Amount],TinyTable[Cost])
 
Upvote 0
I am not convinced that you are going to be able to expand the table on a protected sheet without unprotecting it, most likely involving VBA.
 
Upvote 0
Do not tables include a total row automaticall? I think it would be row 5 in the second example.

just thinking
Not automatically, but it can be activated. This solves another one of my problems, just not this one. Thank you for reminding me about this. Completely forgot about it.
 
Upvote 0
Welcome to the MrExcel board!


For that sort of thing I put the totals at the top. That way ..
  • You don't ever have the problem of adjusting rows like you are asking about here, and
  • The totals are (or can be made to be) always visible at the top of the sheet (by using FreezePanes) without scrolling, no matter how big the table below gets. Those totals are also right near the relevant table heading so that if you have a lot of columns in your table it is still very easy to tell which value refers to which heading.

22 05 20.xlsm
ABCDEFG
1Total4450Data table 1 (in another sheet)AmountCost
2Product A150
3Tiny TableAmountCostProduct F2100
4Product A150Product Q1200
5Product F2100
6Product Q1200
7
8
Table Totals
Cell Formulas
RangeFormula
B1B1=SUM(TinyTable[Amount])
C1C1=SUMPRODUCT(TinyTable[Amount],TinyTable[Cost])
You are absolutely correct. I should have been more clear about the requirements. I don't always only have the "Total" at the bottom (which I can add to the table itself instead to simplify things), but sometimes I have something similar to a "summary page", where I might be having one table below another one. If expanding the one above with one row I would have to "push" the lower one (or several) down one row. From what I understand this maybe ain't as easy as I was hoping, and might require me to have all these tables in a hidden sheet and filling the "presentation sheet" with formulas only containing calculations to decide what to present at what row. A bit of a nightmare to make those huge formulas, but I guess it might work with some math magic. I was just hoping for some way to associate tables to eachother by offset, as in "Table 2 is always in the same column as Table 1, but at (ROWS(Table1) + 2) or something like that.

Regards,
P
 
Upvote 0
If dealing with a table that is going to be expanding/contracting then I don't like to put anything under it - either another table of other data - for the very reason that things too easily become unaligned.
 
Upvote 0

Forum statistics

Threads
1,215,387
Messages
6,124,637
Members
449,177
Latest member
Sousanna Aristiadou

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