Inserting Variable numbers of Rows on Different Named Sheets

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,595
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I am struggling to code the following routine.

In worksheet 2, I have counted the number of rows of data and came up with a value. (eg. 25)
I need to copy these rows over to worksheet 1, which is dynamically named based on the cell value at A2 (WPE), but the available rows I have to paste to is 22.

So, as an example, if the number of rows needed to paste over to worksheet "WPE" is >22 (true), I need to insert 7 rows after row 8 (in "WPE"), ensuring these new rows hold the same formulae and formatting as the other 18.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,224,614
Messages
6,179,906
Members
452,949
Latest member
beartooth91

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