How to transfer file in a subfolder into another subfolder inside it

VeeBa

Board Regular
Joined
Apr 22, 2017
Messages
82
hello experts! I need your expert advise. I have a folder named Reports and inside this folder, it has multiple subfolders.

I am currently doing a macro and my goal is to transfer a specific excel file (with filename "Gross Contribution Report") found inside a subfolder (example Japan) into its subfolder named "Previous FF" folder. and if file is already existing in the previous FF folder, i want it to override it.

My problem is that i have multiple sub folders (per country) and all subfolders have "Gross contribution Report" and a sub folder Previous FF in it. I dont know how to go thru with this since the subfolders (countries) are not fixed, sometimes it has 3 subfolders sometimes more.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
vFile = "MyFile.xls"
vSrcDir = "c:\oldfolder"
vTargDir = "f:\newfolder"

name vSrcDir & vFile as vTargDir & vFile
 
Upvote 0
Hello! Thanks but im not sure I understand your reply :( The target folder is not necessary a new folder but an existing folder already named Previous FF. This folder is inside the subfolder country (example Japan) and the subfolder country (ex Japan and all other countries) is found inside the main folder named reports.
 
Upvote 0
To further help in visualization.
I have the main folder named "Reports" which is saved in my desktop.
Within this folder are multiple subfolders (names are countries, example Japan, Korea, Africa, etc)
Within these country subfolders are another subfolder named "Previous FF" and an excel file named "Gross Contribution Report"

All these country subfolders have "Previous FF" folder and Gross contribution Report in it.

What I need to do is to loop every country subfolders and transfer the Gross contribution report file into the Previous FF folder and override any report in it.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,265
Members
452,627
Latest member
KitkatToby

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