VBA code copy specific range of cells even when additional rows are added

topswim

Board Regular
Joined
May 14, 2002
Messages
133
Office Version
  1. 365
Platform
  1. Windows
what I'm trying to do is copy a specific range of cells O29:O38 to O18:O27 automatically using VBA. I then Insert another 10 rows before O29 and enter new data in O29:O38 again and repeat the process: The information will also be retained from O29:O38 below the inserted cells. If there is a formula I can use that will always refence O29:O38 after inserting my rows that would help also, but so far, I lose the reference to those cells after I insert my rows even if formulas are set up in O18:O27 as $O$29, $O$30, etc. After inserting rows in this example it now displays in O18 as =$O8$38.

FYI- I will be performing other functions on cells O18:O27 prior to inserting my rows
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
If all you have got below o29 : 38 is data why not just move the data with VBA instead of inserting new lines then all your equations will stay the same.
 
Upvote 0
If all you have got below o29 : 38 is data why not just move the data with VBA instead of inserting new lines then all your equations will stay the same.
Trying to see how that may work
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,718
Members
448,986
Latest member
andreguerra

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