Rename files based on main folders name

developer12345

New Member
Joined
Feb 6, 2023
Messages
2
Office Version
  1. 365
  2. 2021
Hi, all, can you please help me :( I am very new to vba

What if I have folders name Sanket , Santosh, Zakir
Inside each of these folders above there is a "result" folder
Inside the result folder there is one "salary.pdf" file
I would like to rename the .pdf file inside the result folder into Sanket-salary, Santosh-salary, Zakir-salary,....etc
Then copy all those new renamed file into a master folder.

Is it possible to do that? How do I code?

Thank you in advance!! I really need your help
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,215,852
Messages
6,127,322
Members
449,374
Latest member
analystvar

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