How to Rename Files In A Folder Using VBA??

liammoohan

Board Regular
Joined
Jan 11, 2008
Messages
72
I have a folder C:\Reporting\A10\

I have an excel sheet which when I run VBA will list all the files in the above folder in column 'A' (see below):

1647282572273.png


The values in column 'B' are what I need the files to be renamed to and was wondering if this can be done using VBA?

Thanks
Liam
 
Tried the code provided and it is Debugging (see image):
As it works a treat on my side so you felt into the bad reader trap ‼​
As written in post #4 the VBA procedure must be located in the worksheet module (rather than a standard one like 'Module1') …​
 
Upvote 0

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.
As it works a treat on my side so you felt into the bad reader trap ‼​
As written in post #4 the VBA procedure must be located in the worksheet module (rather than a standard one like 'Module1') …​
Thanks Marc L; working now.

I do need some new glasses as my current ones broke last week.

Maybe that will help with the reading in future ?; thanks again (y)
 
Upvote 0
I had myself the same bad reader trap issue with my post #3 !​
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,276
Members
449,075
Latest member
staticfluids

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