VBA for copying and pasting

atkinse

New Member
Joined
Feb 20, 2015
Messages
4
Firstly apologies for not putting my existing code on my post but it is on my work computer and I am not permitted to post from there.
I am trying to copy data from various Excel workbooks into a master sheet. I have reviewed loads of posts on here but can’t get these to work for what I am trying to achieve.
I am using the Applications.GetOpenFilename to allow users to select those files that they want to copy data from into the master spreadsheet (but not open them). They will open the master sheet manually and run the macro from a button on it. The master workbook has a tab called Consolidation which I need the data to be copied into. The file name of the master sheet will change every month so I have been using active worksheet for this. The Consolidation sheet will have headings which match those on the individual workbooks so I don’t want the headings copied.

The tab/sheet name from which I want to copy is called Key Control Testing Plan in each of the workbooks that I want to copy from.

I just can’t work out the code to loop through the files and copy and paste the data into the master sheet. The number of rows will differ for each so I need to find the last row each time and paste on the next blank row in the master sheet.

The headings are rows 1 and 2 in the individual files to copy from and in the consolidated sheet.

It is driving me mad and up against it timewise so I thought posting on here was the best way to get help from you Excel superbrains!

Thanks in advance!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,214,839
Messages
6,121,891
Members
449,058
Latest member
Guy Boot

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