View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_2_] Dave Peterson[_2_] is offline
external usenet poster
 
Posts: 420
Default How can delete file by Marco

First, I wouldn't do this kind of thing using excel.

I'd use windows search/find to look for:
*test*.xl*
Then I could look at the results and check to see if each should be deleted.

If I didn't have to verify the results, I could just select all the files on the
right hand side window (by hitting ctrl-a) and hit the delete key.

But if you wanted to search all of drive C: including subfolders, then you could
use application.filesearch in xl2003 and before.

If you're using xl2007 or higher (works in previous versions, too), you can use
code at Ron de Bruin's site to loop through subfolders.

He has a couple of ways he
http://www.rondebruin.nl/fso.htm
and
http://www.rondebruin.nl/copy3.htm

Again, I wouldn't use excel for this -- even though it's possible.

On 02/12/2011 08:51, Hello wrote:
Hi Dave,

How can I delete file have / include "test" in file name under C drive
and don't know the path? I want to delete all files have / include
"test" .


--
Dave Peterson