Help with VBA - How to extract multiple columns from multiple sheets from multiple workbooks

mrsbunnybunny1

New Member
Joined
Aug 12, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have about 50 files with data in columns A through G. All 50 files have different names but data is in worksheets named all the same. I am trying to get a VBA code to:

1. Open each of the 50 files.
2. copy columns c and e of file 1, Sheet 1
3. paste in the master workbook Sheet 1
4. copy columns c and e of file 2, Sheet 1
5. paste in the master workbook Sheet 1 to the right of the columns from file 1
6. copy columns c and e of file 3, Sheet 1
7. paste in the master workbook Sheet 1 to the right of the columns from file 2
[and so on and so forth until there are no more files]
8. copy columns c and e of file 1, Sheet 2
9. paste in the master workbook Sheet 2
10. copy columns c and e of file 2, Sheet 2
11. paste in the master workbook Sheet 2 to the right of the columns from file 1
[and so on and so forth until there are no more files and do so until there are no more sheets]

All can be value paste.

Can this be done? Thanks in advance.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,214,990
Messages
6,122,626
Members
449,093
Latest member
catterz66

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