Hello all,
I have this button I made on one of my sheets in order to add rows to tables as more entries ar required. As all tables work in reference to the first one everything works fine but for one thing: On the first table one of the columns references the corresponding rows in a subsequent table but (I'm guessing because in the order of operations said table is created after the new row is added in the first one) this causes the formula to not copy properly, resulting either in a SPILL error if it's referencing the table column or the cell reference becoming the new cell below the second table if using a range. Is there an easy fix for this that anyone has?
Here is the module for the button:
'"ADD ENTRY" button on "OVERVIEW" tab which adds an entry to the list on the "OVERVIEW" tab, "DETAILS" tab, "SUMMARY" tab & "REPORT" tab
Sub Add_Entry()
'"OVERVIEW" tab row add
ActiveSheet.Unprotect Password:="XXX"
ActiveSheet.ListObjects("Table1").ListRows.Add
ActiveSheet.Protect Password:="XXX"
'"DETAILS" tab row add
Sheets("DETAILS").Unprotect Password:="XXX"
Sheets("DETAILS").ListObjects("Table11").ListRows.Add
Sheets("DETAILS").Protect Password:="XXX"
'"SUMMARY" tab row add
Sheets("SUMMARY").Unprotect Password:="XXX"
Sheets("SUMMARY").ListObjects("Table17").ListRows.Add
Sheets("SUMMARY").Protect Password:="XXX"
''"REPORT" tab row add
Sheets("REPORT").Unprotect Password:="XXX"
Sheets("REPORT").ListObjects("Table14").ListRows.Add
Sheets("REPORT").Protect Password:="XXX"
'Make sure to bring user back to the "OVERVIEW" tab
ActiveWorkbook.Sheets("OVERVIEW").Activate
I have this button I made on one of my sheets in order to add rows to tables as more entries ar required. As all tables work in reference to the first one everything works fine but for one thing: On the first table one of the columns references the corresponding rows in a subsequent table but (I'm guessing because in the order of operations said table is created after the new row is added in the first one) this causes the formula to not copy properly, resulting either in a SPILL error if it's referencing the table column or the cell reference becoming the new cell below the second table if using a range. Is there an easy fix for this that anyone has?
Here is the module for the button:
'"ADD ENTRY" button on "OVERVIEW" tab which adds an entry to the list on the "OVERVIEW" tab, "DETAILS" tab, "SUMMARY" tab & "REPORT" tab
Sub Add_Entry()
'"OVERVIEW" tab row add
ActiveSheet.Unprotect Password:="XXX"
ActiveSheet.ListObjects("Table1").ListRows.Add
ActiveSheet.Protect Password:="XXX"
'"DETAILS" tab row add
Sheets("DETAILS").Unprotect Password:="XXX"
Sheets("DETAILS").ListObjects("Table11").ListRows.Add
Sheets("DETAILS").Protect Password:="XXX"
'"SUMMARY" tab row add
Sheets("SUMMARY").Unprotect Password:="XXX"
Sheets("SUMMARY").ListObjects("Table17").ListRows.Add
Sheets("SUMMARY").Protect Password:="XXX"
''"REPORT" tab row add
Sheets("REPORT").Unprotect Password:="XXX"
Sheets("REPORT").ListObjects("Table14").ListRows.Add
Sheets("REPORT").Protect Password:="XXX"
'Make sure to bring user back to the "OVERVIEW" tab
ActiveWorkbook.Sheets("OVERVIEW").Activate