insert row into multiple tables

MCC123

New Member
Joined
Apr 17, 2019
Messages
13
Hi all,
I have a worksheet that I set up with 47 tables I need to be able to insert a row above the last line of each of table and copy formulas, cond. form. but not values. I have a code but excel has to reference it 47 times and in turn it takes for ever to complete and it copies cell format but not formulas and Cond. Form. ....I was curious if there is an easier way? I am very new to VBA.....thanks in advance for any help.


here is the macro code I have assigned to a button

Sub Insert Row()

ThisWorkbook.Sheets("Sheet1").Range("Table1").Select
Rows(Selection.Row).Insert shift:=xlDown


this is repeated 46 times in the sub range.

ThisWorkbook.Sheets("Sheet1").Range("Table47").Select
Rows(Selection.Row).Insert shift:=xlDown

End Sub
 
I tried your code on a different copy of the sheet and it works great!


YOU DA MAN PAUL!! Thx a bunch!
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
I tried your code on a different copy of the sheet and it works great!


YOU DA MAN PAUL!! Thx a bunch!
 
Upvote 0

Forum statistics

Threads
1,223,632
Messages
6,173,469
Members
452,516
Latest member
archcalx

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