Lookup "Name Statement" in VBA Help
Dim OldName, NewName
OldName = "OLDFILE": NewName = "NEWFILE" ' Define file names.
Name OldName As NewName ' Rename file.
OldName = "C:\MYDIR\OLDFILE": NewName = "C:\YOURDIR\NEWFILE"
Name OldName As NewName ' Move and rename file.
> Calling all Excel programming brains,
>
[quoted text clipped - 3 lines]
> Thanks,
> Peter
Peter,
Depending on what you actually want to do, try something like
Sub AAA()
Dim DestinationFolder As String
Dim SourceFileName As String
Dim DestinationFileName As String
DestinationFolder = "C:\Test" '<<< CHANGE
SourceFileName = "C:\Test1.txt" '<<< CHANGE
DestinationFileName = "C:\Test\Test2.txt" '<<< CHANGE
If Dir(DestinationFolder, vbDirectory + vbHidden) = vbNullString Then
' folder does not exist, create it
MkDir DestinationFolder
End If
'''''''''''''''''''''''''''''''
' If you want to COPY the file,
'''''''''''''''''''''''''''''''
FileCopy SourceFileName, DestinationFileName
'''''''''''''''''''''''''''''''
' If you want to MOVE the file.
'''''''''''''''''''''''''''''''
Name SourceFileName As DestinationFileName
End Sub
You'll probably want to add some error checking to ensure the file exists,
and the destination file does not exist, but the code above should get you
started.

Signature
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email on the web site)
> Calling all Excel programming brains,
>
[quoted text clipped - 3 lines]
> Thanks,
> Peter