Add a new row in two tables at once on the second to the last row (on separate tabs)
Alright... I am running around trying to find a way to work this, and I'm not very good with macros yet.
I have a sheet that summarizes about 15 other sheets, but I need to make a button that will allow the user to create a row to enter in new data in one of the other 15 sheets. I have two issues I'm trying to solve:
1) create a new row on the row above the last row of the table (the last row will be used to sum up the numbers above it
2) When the user creates a new row in the one sheet, to make it also create a new row in the summary sheet.
Below is what I got so far for the macro button, but I don't know enough about macros to get it to work for what I need it for. If anyone could help I would greatly appreciate it.
Private Sub CommandButton1_Click()
Dim the_sheet As Worksheet
Dim table_list_object As ListObject
Dim table_object_row As ListRow
Set the_sheet = Sheets("General Conditions")
Set table_list_object = the_sheet.ListObjects(1)
Set table_object_row = table_list_object.ListRows.Add
table_object_row.Range(-2, 1).Value = "New Item"
last_row_with_data = the_sheet.Range("A" & Rows.Count).End(xlUp).Row
the_sheet.Range("B" & last_row_with_data) = "Title Name"
the_sheet.Range("C" & last_row_with_data) = "Ref Number"
Last edited by jbenk; 11-26-2015 at 09:51 AM.
Re: Add a new row in two tables at once on the second to the last row (on separate tabs)
Here is the file I'm working on.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By 823 in forum Excel Programming / VBA / Macros
Last Post: 02-08-2015, 02:02 PM
By RO24 in forum Excel Formulas & Functions
Last Post: 10-02-2014, 11:04 AM
By NFLexcel in forum Excel Formulas & Functions
Last Post: 08-07-2014, 02:22 AM
By tconnell1965 in forum Excel Programming / VBA / Macros
Last Post: 09-18-2013, 07:04 AM
By nicholasoh in forum Excel Programming / VBA / Macros
Last Post: 07-19-2011, 02:20 AM
By squidg in forum Excel General
Last Post: 03-09-2011, 05:59 PM
By ukphoenix in forum Excel General
Last Post: 11-30-2009, 02:35 PM
Search Engine Friendly URLs by vBSEO 3.6.0 RC 1