Add row to table based on second to last row

wbstadeli

Board Regular
Joined
Mar 11, 2016
Messages
153
Office Version
  1. 365
Platform
  1. Windows
Hi friends,

I want to add a new row to my table "Time_log" based on if there is any content in the second to last row of the table (the very last row is my "totals" row). I want this to trigger whenever someone adds content to the second to last row, so that it make a new row available for more entries. So probably trigger with worksheet change event? Unless there is a better option?

Thanks!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
try:

remove your Total row

select whole range and use Ctrl+T (it will change your range to Excel Table)
click enywhere inside the table and from the right click menu select : Table - Totals Row
under appropriate column in Totals Row set: SUM, Average or whatever you want

add new row:
  1. select bottom right cell with data (but not in Totals Row)
  2. hit TAB key
  3. enter new data
  4. if you want more rows repeat these steps
 
Last edited:
Upvote 0
Sorry, i guess i wasn't clear on what i wanted. I need a code to run with a worksheet change event, that looks at Column #1 of my table "Time_log". If i add data to column 1 in my table, run code to check if second to last row (in table "Time_log") has any values (content), then add row to table, if not, then do nothing. I still need my "totals" row which is the very last run in table.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,160
Members
453,021
Latest member
Justyna P

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