Macro VBA code for copying data from table and pasting it at the end of another table

b_gernert

New Member
Joined
Sep 27, 2021
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
Hello,

Sorry I am new to this forum and new to macros and power queries so bear with me.

I created a power query to pull data from multiple files within a folder, combine them, and import them into a workbook as a table. My intention is to use this table as a master spreadsheet. When I rerun the power query it overwrites all of the changes I made in the table. Is there a way to have the power query add to the existing table instead of replace it?

My workaround was to create two sheets/two identically structured tables in the workbook. The first sheet titled, "Power Query", contains the data from the power query and the second sheet, titled "Case Note Master Data" contains the master spreadsheet. I figured I could write a macro to copy the data from the table in the Power Query sheet and paste it at the end of the table in the Case Note Master Data sheet. This doesn't really work when recording the macro. Can someone help me out with the VBA code?

I am open to alternatives to what I have mentioned as well.

thanks a bunch,
Ben
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,215,066
Messages
6,122,947
Members
449,095
Latest member
nmaske

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