Si2873
07-10-2019, 02:05 AM
I have a table called Table1 on Sheet1 of an Excel workbook which can contain any number of rows. I want to add a row below the last row of the table, which I am doing with:
Sub insertRow()
Dim ws As Worksheet
Set ws = ActiveSheet
Dim tbl As ListObject
Set tbl = ws.ListObjects("Table1")
tbl.ListRows.Add
I now want to add SUM functions to the new last cell of 3 Table1 columns (Quantity, Price, Cost).
I would appreciate it if someone could give me some guidance on how to achieve this.
Finally, I would like to reference these SUM values from Sheet2 e.g. place the Sum of Table1 column Cost into Cell A1 on Sheet2.
Again, any help with this would be greatly appreciated.
TIA
Sub insertRow()
Dim ws As Worksheet
Set ws = ActiveSheet
Dim tbl As ListObject
Set tbl = ws.ListObjects("Table1")
tbl.ListRows.Add
I now want to add SUM functions to the new last cell of 3 Table1 columns (Quantity, Price, Cost).
I would appreciate it if someone could give me some guidance on how to achieve this.
Finally, I would like to reference these SUM values from Sheet2 e.g. place the Sum of Table1 column Cost into Cell A1 on Sheet2.
Again, any help with this would be greatly appreciated.
TIA