Excel VBA: How do I auto shift cells down when new data is inserted automatically?

dylantzips

New Member
Joined
Aug 17, 2018
Messages
1
To start off, I am new to using VB in excel. Here is my issue: I am using DreamReport to send out plant data to an excel file every 24 hours. I am using a single, static excel file.
The problem is that by using a static file, the data is replaced every day. This is because the data is automatically placed in the same group of cells, and the previous 24 hours get overwritten. Here is how the data is placed: http://prntscr.com/kjsgo1

kjsgo1

So, I need a script that will shift the new data, and all of the prior data down, immediately after the report adds the data from the screenshot, so that no data is overwritten.
Thanks in advance for anyone that helps! Please ask questions if I was not clear about anything.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Try using Record function to get the VBA starting point
- may need modifying and trimming it but most of what you need is often there :)

This copies the data from A2:E4 and inserts at A20, shifting the relevant cells down.
Tailor to your needs

Code:
    Range("A2:E4").Copy
    Range("A20").Insert Shift:=xlDown
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,947
Messages
6,175,559
Members
452,652
Latest member
eduedu

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