Loop and match cell value in master file to file names in the folder and copy data from master file to each file in the folder

bebo201022

New Member
Joined
Sep 24, 2017
Messages
3
Hi all,

I just made a code to collect data from all excel sheets in one folder into one master file.


I need a code to reflect any update in the master file to all files in the folder.

So the code should check the column G starting from G7 and if data in G matches any file name in the folder, it should open the file and delete its contents starting from raw 7 and replace it with data from master file

EX.

G7:G12 contains data "Apple"
There are file called "Apple"

the code should open file "Apple" in the folder called " C:\My documents" and delete all file rows starting from row 7
and copy range row7:row12 from master file and paste it to "Apple" and save and close it


then loop for all files in the folder " C:\My documents"
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,223,714
Messages
6,174,052
Members
452,542
Latest member
Bricklin

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