Copying from multiple files to master file (specific sheets)

ll4321

New Member
Joined
Jun 15, 2022
Messages
1
Hi All,

I'm a VBA newbie.. Tried to search around but seems couldn't find a solution for my problem. Would be grateful if someone could help...

What I'm trying to do is as follows:

1. I've got a few files stored in the following path say:
C:// desktop/ 2022Q1 /source/ abc.xlsx
C:// desktop/ 2022Q1 /source/ def.xlsx
C:// desktop/ 2022Q1 /source/ ghi.xlsx

in each of the above excels, they all have a number of sheets...
I'd like to copy and paste the content from sheet abc (from file abc.xlsx), sheet def from (file def.xlsx) etc. to the master file (say master.xlsm) which consists of sheet abc, sheet def
the aim of the above action is just to simply copy and paste from the source file (from the first row and column to the last row and column ) into the master file

2. the above action would repeat for the next quarter where the source files will be saved in the following path:
C:// desktop/ 2022Q2 /source/ abc.xlsx
C:// desktop/ 2022Q2 /source/ def.xlsx
C:// desktop/ 2022Q2 /source/ ghi.xlsx

My question is : are there any easy methods to repeat the above for the upcoming quarters or the only method is to update the path in the vba code manually?

I've searched around and seems like someone suggested to use Application.GetOpenFilename ...
however, given i need to paste the sheets in specific sheets in the master file (can I still use Application.GetOpenFilename to perform the above action)?

Thanks in advance!
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Have you thought about linking cells to the source workbooks, then you just do Data/Edit Links/Change source to point to the new quarter when necessary (well, do that command per source file).
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,742
Members
448,989
Latest member
mariah3

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