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

cjcass

Well-known Member
Joined
Oct 27, 2011
Messages
683
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

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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