Using VB to renam files

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Hi all

I have used some from the help screen of excel to be able
to find and parse file names in pre-defined folders. What
I would like to know is:

if I find a filename called, say, 01 File 1.XLS and I want
to rename it as just File 1.XLS, how can I do that.

The files are listed using a For : Next loop using

..FilesFound(i) and I have tried to use the code

..FilesFound(i).Filename = fn3 where fn3 is the new name I
want to give the file on disk but that just generates an
error that I can't find a response for.

Any help gratefully received. Thanks
 
Hi Peter,

Try

Name .FilesFound(i).Filename As fn3

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top