Delete row with two tables

claven123

Board Regular
Joined
Sep 2, 2010
Messages
83
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I have two tables one in B1:G1 and the other in L1:T1, both go down hundreds of rows. If I only had one table I could delete a row, but it seems if I have two tables I can't delete one or more rows.

I need to delete the row from BOTH tables, not just one of the tables.

I saw some VBA to delete one row from one table, which I suppose I could use.

Dennis
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
A little clunky, but you can convert them to a range, delete the row, and then change them back to tables. Not sure what that would do to your references though.
 
Upvote 0
Something like this (changing names to meet your needs) will delete any row from any table...


VBA Code:
Dim tbl As ListObject, tbl2 As ListObject
    Set tbl = ActiveSheet.ListObjects("Table13")
    Set tbl2 = ActiveSheet.ListObjects("Table130")
    tbl.ListRows(2).Delete
    tbl2.ListRows(4).Delete
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,231
Members
449,091
Latest member
jeremy_bp001

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