The Excel VBA Name statement changes the name of file or directory to a new given name.
VBA Name Statement Syntax
The syntax for the VBA Name statement in VBA is:
1 | Name oldName As new Name |
Parameters
oldName
The current full path to the file or directory you want to rename.
newName
The new full path to the file or directory.
Example VBA Name Statement usage
1 2 3 | Name "C:\OldFileName.txt" As "C:\NewFileName.txt" Name "C:\OldFolderName\" As " C:\NewFolderName\" |