Look for a match for external file and rename it in vba

zhang275

New Member
Joined
Jun 6, 2013
Messages
4
Hello all:
I have run into a problem that I was given a list of file names in the spread sheet, and I will need to look for all files(located where else in a shared drive) with the name that match the first six character in the file names given in the spread sheet, and rename all that files to some other names given in the same spread sheet, and kill all the origional files. Getting really frustrated here.:confused: I will value and appreciate your help. Thanks in advance.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Welcome to MrExcel board....

give some examples of file names to find and what to be renamed. Where are the files to be saved? in the same location? Are all the files in the same directory?
 
Upvote 0
Example: I want to perform the following task
Given a folder on the desktop with numbers of pdf files in it as (274283.1.pdf 274284.8 pdf ....) In the Spred sheet we have the following:
Drawing numbers ................................Finalized drawing names
274283..............................................274283 230KV.45kv. 6R
274284..............................................274284 230KV. sw swt 4R11

what i want to do is If the first six digits of the pdf file match the drawing number, then we rename that pdf file used the finalized name crosponding to that drawing number but still in pdf form in the same folder where the old ones at, there may be 400 or more pdf files in the folder.

Thanks for your help
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,428
Members
449,083
Latest member
Ava19

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