Change pdf files names in folder with VBA

Volkof

New Member
Joined
Oct 16, 2011
Messages
37
Hello all,

i have this:
A-scanB-Name
Scan01GR18987564-Plat1
Scan02GR18987564-Plat2
Scan03SR-85-18987654654-PL1
Scan04SR-85-18987654654-PL2
Scan05GT6576846465-Plat1
Scan06GT6576846465-Plat2
Scan08GR18987798-Plat1
GR18987798-Plat2
Scan07GR18897-Plat1

<tbody>
</tbody>


This excel file will be in a folder where I have many subfolders containing pdf scans ex. Scan01, Scan 02... like in the column A.
I need Excel scan the folders and if finds a pdf named ex. Scan02, change the name from Scan to the name in column B. So first Scan05 will be GT6576846465-Plat1. A hard part is also with the extension. I don't want the file to be renamed GR18987564-Plat1.pdf because with the extension will be GR18987564-Plat1.pdf.pdf.
Any codes available?

Thank you very much and have a nice day!
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,214,833
Messages
6,121,864
Members
449,052
Latest member
Fuddy_Duddy

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