Change pdf files names in folder with VBA

Volkof

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

i have this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]A-scan[/TD]
[TD]B-Name[/TD]
[/TR]
[TR]
[TD]Scan01[/TD]
[TD]GR18987564-Plat1[/TD]
[/TR]
[TR]
[TD]Scan02[/TD]
[TD]GR18987564-Plat2[/TD]
[/TR]
[TR]
[TD]Scan03[/TD]
[TD]SR-85-18987654654-PL1[/TD]
[/TR]
[TR]
[TD]Scan04[/TD]
[TD]SR-85-18987654654-PL2[/TD]
[/TR]
[TR]
[TD]Scan05[/TD]
[TD]GT6576846465-Plat1[/TD]
[/TR]
[TR]
[TD]Scan06[/TD]
[TD]GT6576846465-Plat2[/TD]
[/TR]
[TR]
[TD]Scan08[/TD]
[TD]GR18987798-Plat1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]GR18987798-Plat2[/TD]
[/TR]
[TR]
[TD]Scan07[/TD]
[TD]GR18897-Plat1[/TD]
[/TR]
</tbody>[/TABLE]


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

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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