vba to rename specific files in folder and it's subfolders

cjcass

Well-known Member
Joined
Oct 27, 2011
Messages
680
Office Version
  1. 2016
Platform
  1. Windows
Hi,
I have a folder located at 'C:\Users\Steve\Desktop\2018 Data' and it has lots of subfolders and sub-sub folders. Throughout all the folders there are lots of .pptx files that I want to rename. The target files have a mixture of names but they all end in 'v1.0(A3)', eg. 'London v1.0(A3)', 'Bristol v1.0(A3)' etc... and I want to rename them all as simply 'Archive File' (there is only one file ending in 'v1.0(A3)' in each subfolder). So, ultimately I will end up with several hundred files all named 'Archive File.pptx' located in the same amount of subfolders. I guess the code will need a wildcard option to locate the files, something like... '*v1.0(A3)'.
Can anyone help with this?
Many thanks.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,215,731
Messages
6,126,539
Members
449,316
Latest member
sravya

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