View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
MyVeryOwnSelf MyVeryOwnSelf is offline
external usenet poster
 
Posts: 213
Default Managing a picture folder with excel data

I have an Excel file with some 2000 records and a folder with some
4000 pictures, the file name of the picture is the same as the id name
in the excel spreadsheet. Over time the some of the pictures have
become redundant, how do I automatically delete the redundant pictures
based on the excel spreadsheet.


Here's one way.

First use the DIR command-line operation to get a folder listing into a
text file. You can start with http://support.microsoft.com/kb/196158.

In a new sheet of the workbook, paste the entire text file into column A.

In column B of the new sheet, use IF and MID and concatenation to
(a) identify which lines are files and
(b) get the file names into column B.

On the new sheet, use VLOOKUP to identify which files have (or don't have)
a corresponding record.

On the original sheet, use VLOOKUP to identify which records have (or don't
have) a corresponding file.