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

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,886
Messages
6,175,194
Members
452,616
Latest member
intern444

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