View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Deleting Duplicate workbooks

http://support.microsoft.com/kb/185476/EN-US/
How To Search Directories to Find or List Files

http://support.microsoft.com/kb/185601/EN-US/
HOW TO: Recursively Search Directories by Using FileSystemObject

http://support.microsoft.com/kb/186118/EN-US/
How To Use FileSystemObject with Visual Basic

are some articles on listing files in a directory. That should get you
started.

--
Regards,
Tom Ogilvy



"Ozzie via OfficeKB.com" wrote:

Dear Experts

Is there a way of being able to check a network folder for file names
containing the same piece of text?

I have a spreadsheet which people now automatically save to a specified
folder "W:\Accounts\Site Daily Bankings\To be posted".

However some people are saving their file more than once (a user problem that
unfortunately won't go away) which I need to filter and delete. The file's
are saved with the site name, then a date stamp, i.e. "SiteName Banking
09Mar2006_152600"

Ideally I would like to search on the first piece of text as it is always the
site, but how would I delete the others ?;

Ie, if I have

SiteName Banking 09Mar2006_152600
SiteName Banking 09Mar2006_152599
SiteName Banking 09Mar2006_152598

I would want to keep "........152600" and delete the other two.

Anybody any idea's?,

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200603/1