It is a example
I don't see you code so I can't use your code
Dim NewN As String
MyPath2 = "C:\New"
If the file exist in both folders you can use this
NewN = MyPath2 & "\" & FNames
Name NewN As Left(NewN, Len(NewN) - 4) & "something.xls"
FNames is the filename that you can use if use the
Dir function to loop through all your files
for a example see this page
http://www.rondebruin.nl/copy3.htm
--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl
"Otto Moehrbach" wrote in message ...
Did you mistype something there? Nname is not in the code you wrote.
Thanks for your help. Otto
"Ron de Bruin" wrote in message
...
Hi Otto
You can use this rename the file in the New folder before you open it
Nname is the full path to the file in the New folder
Name NewN As Left(NewN, Len(NewN) - 4) & "something.xls"
--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl
"Otto Moehrbach" wrote in message
...
Excel 2003
I'm helping an OP to automate a tiresome task of copying from file to
file,
over many, many files.
The problem I see is that the source and destination files have the
exact same name. In fact, that is the criteria by which the destination
file is selected. Since a file has to be open to copy from, and a file
has
to be open to paste to, how to get from here to there?
The only solution I can see at the moment is to use a dummy file in
between.
Now that I've written the above I see another way. Change the name of
the
source file (it will be discarded after the copy/paste).
Given that, what is the code to change the name of a file, given the
full
path is known.
Is there a better way? Thanks for your help. Otto