Thread: Renaming
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Renaming

Hi Ian,

If your files are (say) C:\One.txt and C:\Two.txt, just use a temporary
intermediate file, say C:|\Temp.txt,

Sub SwitchFileNames()

Name "C:\One.txt" As "C:\Temp.txt"

Name "C:\Two.txt" As "C:\One.txt"

Name "c:\Temp.txt" As "C:\Two.txt"

End Sub


---
Regards,
Norman


"ianripping " wrote in message
...
Not too sure if this is the related forum.

I want to create a batch file that looks at file 1's name, copies that
and then looks at file 2's name and copies that and then it renames
file 1 with file 2's name and vice versa.

Any ideas? Can it be done with batch programming or does it have to be
done in C++ or java or can it be done in vba?

Kind Regards

Ian Ripping


---
Message posted from http://www.ExcelForum.com/