View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Darren Hill[_2_] Darren Hill[_2_] is offline
external usenet poster
 
Posts: 80
Default Rename Batch of Files in VBA

I'm using Excel 2000.
I have a big macro to create - I don't expect the group to do all my work,
information on how to get started would be good for now.

My goal:
I have a directory ("C:\My Documents\Archive") which contains multiple
subdirectories, each of which contains files to be renamed. Some
subdirectories also have their own subfolders.
Those files whose name starts with the string "File" needs that string
replaced with the folder name. If the file does not start with the string
"File", the immediate folder name gets added to the start of the folder
name.
The filelist will include non-Excel files.

I can do the string replacing bit, it's the creating a list of folders and
their content files, and then getting the immediate folder and using that to
rename the files that I have no idea about, and Google isn't helping much :)

Thank in advance.

Darren