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:

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,214,886
Messages
6,122,093
Members
449,064
Latest member
Danger_SF

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