Search column & edit file names

scrupul0us

Well-known Member
Joined
Sep 7, 2004
Messages
641
Sort of an interesting situation here... I'm reconciling an unfortunate deletion of about 200 image files from a clients webserver that all had unique generated ID's in front of them... luckily the DB wasn't altered so I have the filename with the unique ID in its entirety in an excel spread sheet...

I have most of the original images minus about 60 or so, all of which do not have the unique ID appended to them and I was hoping an quick and dirty macro could easily solve my problem

I have a column, column B (row 1 is a header row) that has all the image names with the unique ID

example:

DB stored name: 555684_10northmainstreet.JPG (this is the value in column B)
The unique ID is: 555684_
The file I have is: 10northmainstreet.JPG

The unique id is always a random number followed by an underscore

What I'm hoping someone can do for me is to write a little macro that parses C:\cplimages to check for the existence of the image file (i have both JPG and BMP) and if it finds it, append the UID to the front of the filename...

possibly worth noting, when i click on the cell with the filename there is a leading single quote visible in the formula bar that isn't visible in the cell data

any help is GREATLY appreciated
 
Last edited:

Some videos you may like

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Watch MrExcel Video

Forum statistics

Threads
1,123,492
Messages
5,601,994
Members
414,490
Latest member
Rip181

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
Top